Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
"use strict";

import { isQADomain } from "./utils/certificateUtils.js";
import { downloadWorkshopCertificate, getUrlWorkshop } from "./workshop.js";

const workshop = await import(`./workshop.js?v=${window.APP.VERSION}`);
const { downloadWorkshopCertificate, getUrlWorkshop } = workshop;

const buildCertificateUrl = (fullname, type) => {
const encodeFullname = encodeURI(fullname);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { handleCertificateSubmit } from "./certificate2.js";
const certificate = await import(`./certificate2.js?v=${window.APP.VERSION}`);
const { handleCertificateSubmit } = certificate;

const certificateCta = document.getElementById("certificateCta");
const certificateModal = document.getElementById("certificateModal");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,14 @@ const buildWorkshopUrl = (fullname, workshopType) => {
return `https://textify.fromdoppler.com/${domainUrl}?fullname=${encodeFullname}&type=workshop&workshoptype=${encodeURI(workshopType)}`;
};

export const downloadWorkshopCertificate = async (fullname) => {
export const downloadWorkshopCertificate = (fullname) => {
const workshopType = getUrlWorkshop();
if (!workshopType) return;
const fileName = `certificacion-emms2025-workshop.png`;
const url = buildWorkshopUrl(fullname, workshopType);

const response = await fetch(url);
if (!response.ok) throw new Error("Error downloading workshop certificate");

const blob = await response.blob();
createDownloadLink(blob, fileName);
const url = buildWorkshopUrl(fullname, workshopType);
const iframe = document.createElement("iframe");
iframe.style.display = "none";
iframe.src = url;
document.body.appendChild(iframe);
iframe.onload = () => document.body.removeChild(iframe);
};
1 change: 1 addition & 0 deletions textify/certificate-emms2025.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Establecer el tipo de contenido
header('Content-Type: image/png');
header("Access-Control-Allow-Origin: https://goemms.com");
header('Content-Disposition: attachment; filename="certificate-EMMSDT25.png"');

// Tamaño de la imagen
$img_w = 1080;
Expand Down
1 change: 1 addition & 0 deletions textify/certificate-emms2025qa.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Establecer el tipo de contenido
header('Content-Type: image/png');
header("Access-Control-Allow-Origin: https://qa.goemms.com");
header('Content-Disposition: attachment; filename="certificate-EMMSDT25-qa.png"');

// Tamaño de la imagen
$img_w = 1080;
Expand Down