Commit d92e1fdd authored by FORESTIER Fabien's avatar FORESTIER Fabien
Browse files

Update contact email template

parent ceb4782e
Pipeline #2492 passed with stages
in 5 minutes and 34 seconds
......@@ -4420,9 +4420,9 @@
"dev": true
},
"handlebars": {
"version": "4.0.12",
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.12.tgz",
"integrity": "sha512-RhmTekP+FZL+XNhwS1Wf+bTTZpdLougwt5pcgA1tuz6Jcx0fpH/7z0qd71RKnZHBCxIRBHfBOnio4gViPemNzA==",
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.0.tgz",
"integrity": "sha512-l2jRuU1NAWK6AW5qqcTATWQJvNPEwkM7NEKSiv/gqOsoSQbVoWyqVEY5GS+XPQ88zLNmqASRpzfdm8d79hJS+w==",
"dev": true,
"requires": {
"async": "^2.5.0",
......@@ -6152,6 +6152,11 @@
"minimist": "0.0.8"
}
},
"moment": {
"version": "2.24.0",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz",
"integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg=="
},
"move-concurrently": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz",
......
......@@ -7,4 +7,5 @@ export const config = {
},
mailerQueue: 'portail-data-send-email',
plateformDataEmail: '',
imageHost: 'https://highway-to-data.alpha.grandlyon.com/email-template-assets',
};
\ No newline at end of file
<mjml>
<mjml lang="fr">
<mj-head>
<mj-title>Contact</mj-title>
<mj-font name="Lato" href="https://fonts.googleapis.com/css?family=Lato" />
<mj-attributes>
<mj-text font-family="Lato" line-height="25px" font-size="16px" />
<mj-text font-family="Lato, sans-serif" line-height="18px" font-size="14px" padding="3% 0 0 0" color="#333744"></mj-text>
<mj-social-element padding="0 5px 0 5px"></mj-social-element>
</mj-attributes>
<mj-style inline="inline">
<mj-style>
.warn-message {
color: "white";
}
.link {
color: white;
font-weight: bold;
}
.pre {
white-space: pre;
}
@media (max-width:480px) {
.title {
padding: 7% 10% !important;
}
}
</mj-style>
</mj-head>
<mj-body>
<mj-wrapper border="1px solid #ccc" padding="0px 0px">
<mj-section background-color="white">
<mj-column>
<mj-image width="250px" src="https://highway-to-data.alpha.grandlyon.com/email-template-assets/datagrandlyoncom.png"></mj-image>
<mj-divider border-color="#ed1c24"></mj-divider>
<mj-text>Une demande de contact a récemment été déposée par l'utilisateur ${options.firstName} ${options.lastName}.</mj-text>
<mj-body width="800px" css-class="body">
<mj-wrapper padding="0">
<mj-section background-color="#333744" padding="3% 6%">
<mj-group>
<mj-column>
<mj-image width="130px" align="left" padding="0" alt="Logo data.grandlyon.com" src="${options.imageHost}/logo_data_neg.png"></mj-image>
</mj-column>
<mj-column>
<mj-image width="80px" align="right" padding="0" alt="Logo Grand Lyon" src="${options.imageHost}/logo_gl_négatif.png"></mj-image>
</mj-column>
</mj-group>
</mj-section>
<mj-text text-decoration="underline">
<mj-section background-color="#f2f2f2" padding="3% 6%">
<mj-column background-color="white" padding="3% 6%">
<mj-text align="center" css-class="title" font-size="18px" font-weight="bold" padding="3% 10%">
Contact
</mj-text>
<mj-text>
Une demande de contact a été déposée le ${options.datetime} par l'utilisateur ${options.firstName} ${options.lastName}.
</mj-text>
<mj-text>
Voici un résumé de la demande :
</mj-text>
<mj-text font-weight="bold">
Email:
</mj-text>
<mj-text padding-left="40px">
<mj-text font-style="italic">
${options.email}
</mj-text>
<mj-text text-decoration="underline">
<mj-text font-weight="bold">
Sujet:
</mj-text>
<mj-text padding-left="40px">${options.subject}</mj-text>
<mj-text font-style="italic">${options.subject}</mj-text>
<mj-text text-decoration="underline">
<mj-text font-weight="bold">
Message:
</mj-text>
<mj-text padding-left="40px" css-class="pre">
<mj-text css-class="pre" font-style="italic">
${options.message}
</mj-text>
<mj-text align="right" padding-top="3%">
L'équipe data.grandlyon.com
</mj-text>
<mj-image align="right" width="105px" padding-right="0" padding-top="1%" alt="Logo data.grandlyon.com" src="${options.imageHost}/logo_data.png"></mj-image>
</mj-column>
</mj-section>
<mj-section background-color="#ed1c24">
<mj-section background-color="#333744" padding="3% 6%">
<mj-column>
<mj-social font-size="15px" icon-size="25px" mode="horizontal">
<mj-social-element href="https://download.data.grandlyon.com/catalogue/srv/fre/rss.search?sortBy=publicationDate&amp;georss=simplepoint&amp;data" src="https://highway-to-data.alpha.grandlyon.com/email-template-assets/rss.png">
<mj-social padding="0" font-size="15px" icon-size="16px" mode="horizontal">
<mj-social-element alt="Logo rss" href="https://download.data.grandlyon.com/catalogue/srv/fre/rss.search?sortBy=publicationDate&amp;georss=simplepoint&amp;data" src="${options.imageHost}/logo_rss.png">
</mj-social-element>
<mj-social-element href="http://www.facebook.com/legrandlyon" src="https://highway-to-data.alpha.grandlyon.com/email-template-assets/facebook.png">
<mj-social-element alt="Logo Facebook" href="http://www.facebook.com/legrandlyon" src="${options.imageHost}/logo_fb.png">
</mj-social-element>
<mj-social-element href="https://twitter.com/grandlyon" src="https://highway-to-data.alpha.grandlyon.com/email-template-assets/twitter.png">
<mj-social-element alt="Logo Twitter" href="https://twitter.com/grandlyon" src="${options.imageHost}/logo_twi.png">
</mj-social-element>
</mj-social>
</mj-column>
......
<mjml>
<mjml lang="fr">
<mj-head>
<mj-title>Contact</mj-title>
<mj-font name="Lato" href="https://fonts.googleapis.com/css?family=Lato" />
<mj-attributes>
<mj-text font-family="Lato" line-height="25px" font-size="16px" />
<mj-text font-family="Lato, sans-serif" line-height="18px" font-size="14px" padding="3% 0 0 0" color="#333744"></mj-text>
<mj-social-element padding="0 5px 0 5px"></mj-social-element>
</mj-attributes>
<mj-style inline="inline">
<mj-style>
.warn-message {
color: "white";
}
.link {
color: white;
font-weight: bold;
}
.pre {
white-space: pre;
}
@media (max-width:480px) {
.title {
padding: 7% 10% !important;
}
}
</mj-style>
</mj-head>
<mj-body>
<mj-wrapper border="1px solid #ccc" padding="0px 0px">
<mj-section background-color="white">
<mj-column>
<mj-image width="250px" src="https://highway-to-data.alpha.grandlyon.com/email-template-assets/datagrandlyoncom.png"></mj-image>
<mj-divider border-color="#ed1c24"></mj-divider>
<mj-text>Bonjour,</mj-text>
<mj-text>Vous nous avez récemment contacté via le formulaire de contact de la plateforme data.grandlyon.com.</mj-text>
<mj-text>Voici un résumé de votre demande:</mj-text>
<mj-text text-decoration="underline">
Sujet:
</mj-text>
<mj-body width="800px" css-class="body">
<mj-wrapper padding="0">
<mj-section background-color="#333744" padding="3% 6%">
<mj-group>
<mj-column>
<mj-image width="130px" align="left" padding="0" alt="Logo data.grandlyon.com" src="${options.imageHost}/logo_data_neg.png"></mj-image>
</mj-column>
<mj-column>
<mj-image width="80px" align="right" padding="0" alt="Logo Grand Lyon" src="${options.imageHost}/logo_gl_négatif.png"></mj-image>
</mj-column>
</mj-group>
</mj-section>
<mj-text padding-left="40px">${options.subject}</mj-text>
<mj-section background-color="#f2f2f2" padding="3% 6%">
<mj-column background-color="white" padding="3% 6%">
<mj-text align="center" css-class="title" font-size="18px" font-weight="bold" padding="3% 10%">
Contact
</mj-text>
<mj-text>
Bonjour ${options.firstName},
</mj-text>
<mj-text>
Votre formulaire de contact a bien été reçu le ${options.datetime} par nos services.
</mj-text>
<mj-text>
Voici un résumé de votre demande :
</mj-text>
<mj-text font-weight="bold">
Sujet:
</mj-text>
<mj-text text-decoration="underline">
Message:
</mj-text>
<mj-text font-style="italic">${options.subject}</mj-text>
<mj-text padding-left="40px" css-class="pre">
${options.message}
</mj-text>
<mj-text font-weight="bold">
Message:
</mj-text>
<mj-text>Nous reviendrons vers vous dans les plus brefs délais.</mj-text>
<mj-text css-class="pre" font-style="italic">${options.message}
</mj-text>
<mj-text>
L'équipe de data.grandlyon.com
</mj-text>
<mj-text>
Nous nous engageons à répondre dans les meilleurs délais.
</mj-text>
<mj-text>
Nous vous remercions de l’intérêt porté à notre plateforme.
</mj-text>
<mj-text>
Bien cordialement,
</mj-text>
<mj-text align="right" padding-top="3%">
L'équipe data.grandlyon.com
</mj-text>
<mj-image align="right" width="105px" padding-right="0" padding-top="1%" alt="Logo data.grandlyon.com" src="${options.imageHost}/logo_data.png"></mj-image>
</mj-column>
</mj-section>
<mj-section background-color="#ed1c24">
<mj-section background-color="#333744" padding="3% 6%">
<mj-column>
<mj-social font-size="15px" icon-size="25px" mode="horizontal">
<mj-social-element href="https://download.data.grandlyon.com/catalogue/srv/fre/rss.search?sortBy=publicationDate&amp;georss=simplepoint&amp;data" src="https://highway-to-data.alpha.grandlyon.com/email-template-assets/rss.png">
<mj-social padding="0" font-size="15px" icon-size="16px" mode="horizontal">
<mj-social-element alt="Logo rss" href="https://download.data.grandlyon.com/catalogue/srv/fre/rss.search?sortBy=publicationDate&amp;georss=simplepoint&amp;data" src="${options.imageHost}/logo_rss.png">
</mj-social-element>
<mj-social-element href="http://www.facebook.com/legrandlyon" src="https://highway-to-data.alpha.grandlyon.com/email-template-assets/facebook.png">
<mj-social-element alt="Logo Facebook" href="http://www.facebook.com/legrandlyon" src="${options.imageHost}/logo_fb.png">
</mj-social-element>
<mj-social-element href="https://twitter.com/grandlyon" src="https://highway-to-data.alpha.grandlyon.com/email-template-assets/twitter.png">
<mj-social-element alt="Logo Twitter" href="https://twitter.com/grandlyon" src="${options.imageHost}/logo_twi.png">
</mj-social-element>
</mj-social>
</mj-column>
......
This diff is collapsed.
......@@ -3,6 +3,7 @@ import * as amqp from 'amqplib';
import { ContactForm, Email, EmailWithoutFrom } from './email';
import { ConfigService } from 'configuration/config.service';
import { buildContactAdminEmail, buildContactUserEmail } from 'email-templates/contact';
import moment = require('moment');
@Injectable()
export class EmailService {
......@@ -22,10 +23,15 @@ export class EmailService {
firstName: contactForm.firstname,
lastName: contactForm.lastname,
email: contactForm.email,
datetime: moment().format('DD/MM/YYYY à HH:mm'),
imageHost: this.config.imageHost,
});
const userEmailBody = buildContactUserEmail({
subject: contactForm.subject,
message: contactForm.text,
firstName: contactForm.firstname,
datetime: moment().format('DD/MM/YYYY à HH:mm'),
imageHost: this.config.imageHost,
});
const adminEmail = new EmailWithoutFrom();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment