Skip to content
Snippets Groups Projects
Commit 6e1ba0ab authored by Hugo SUBTIL's avatar Hugo SUBTIL
Browse files

feat: add site mail signature

parent b2b7b5b5
No related branches found
No related tags found
2 merge requests!46Recette,!45Dev
...@@ -2,5 +2,3 @@ Bonjour<br /> ...@@ -2,5 +2,3 @@ Bonjour<br />
<br /> <br />
Une nouvelle structure a été revendiquée. Pour valider ou refuser la demande, merci de vous rendre sur Une nouvelle structure a été revendiquée. Pour valider ou refuser la demande, merci de vous rendre sur
<a href="<%= config.protocol %>://<%= config.host %><%= config.port ? ':' + config.port : '' %>/admin">ce lien</a>. <a href="<%= config.protocol %>://<%= config.host %><%= config.port ? ':' + config.port : '' %>/admin">ce lien</a>.
<br />
Ce mail est un mail automatique. Merci de ne pas y répondre.
...@@ -2,12 +2,3 @@ Bonjour,<br /> ...@@ -2,12 +2,3 @@ Bonjour,<br />
<br /> <br />
La fiche structure: <strong><%= name %></strong> a été créée après récupération des données aptic. Elle correspond La fiche structure: <strong><%= name %></strong> a été créée après récupération des données aptic. Elle correspond
potientiellement a la structure existante : <strong><%= duplicatedStructureName %></strong>. potientiellement a la structure existante : <strong><%= duplicatedStructureName %></strong>.
<br />
<br />
Cordialement,
<br />
<br />
L'équipe RES'in
<br />
<br />
Ce mail est un mail automatique. Merci de ne pas y répondre.
Bonjour,<br /> Bonjour,<br />
<br /> <br />
Votre adresse email a été modifiée, si vous en avez bien fait la demande, Votre adresse email a été modifiée, si vous en avez bien fait la demande,
<a href="<%= config.protocol %>://<%= config.host %><%= config.port ? ':' + config.port : '' %>/change-email/<%= token %>" <a
href="<%= config.protocol %>://<%= config.host %><%= config.port ? ':' + config.port : '' %>/change-email/<%= token %>"
>cliquez ici pour valider le changement.</a >cliquez ici pour valider le changement.</a
> >
<br />
Ce mail est un mail automatique. Merci de ne pas y répondre.
...@@ -8,5 +8,3 @@ cliquer sur le lien suivant : ...@@ -8,5 +8,3 @@ cliquer sur le lien suivant :
>ce lien</a >ce lien</a
><br /> ><br />
Si vous n'avez pas demander de réinitiallisation de votre mot de passe, merci d'ignorer cet email. Si vous n'avez pas demander de réinitiallisation de votre mot de passe, merci d'ignorer cet email.
<br />
Ce mail est un mail automatique. Merci de ne pas y répondre.
Bonjour<br /> Bonjour<br />
<br /> <br />
La demande de rattachement de votre compte a la structure <strong><%= name %></strong> a été La demande de rattachement de votre compte a la structure <strong><%= name %></strong> a été
<strong><%= status %></strong>. <strong><%= status %></strong>. <%if (status === 'refusée') { %>
<br /> <p>
<br /> Vous considérer qu’une erreur a été commise, vous pouvez les contacter les administrateurs à l’adresse
Ce mail est un mail automatique. Merci de ne pas y répondre. <a href="mailto:inclusionnumerique@grandlyon.com">inclusionnumerique@grandlyon.com</a>
</p>
<% } else{ %>
<p>Vous pouvez dorénavant mettre à jour la fiche de votre structure</p>
<% } %>
...@@ -12,10 +12,3 @@ ou refuser la demande ...@@ -12,10 +12,3 @@ ou refuser la demande
href="<%= config.protocol %>://<%= config.host %><%= config.port ? ':' + config.port : '' %>/join?id=<%= id %>&userId=<%= userId %>&status=false" href="<%= config.protocol %>://<%= config.host %><%= config.port ? ':' + config.port : '' %>/join?id=<%= id %>&userId=<%= userId %>&status=false"
>cliquant ici</a >cliquant ici</a
>. >.
<br />
Cordialement,
<br />
L'équipe RES'in
<br />
<br />
Ce mail est un mail automatique. Merci de ne pas y répondre.
...@@ -6,10 +6,3 @@ acteurs de l'inclusion numérique de la Métropole de Lyon. Pouvez-vous nous aid ...@@ -6,10 +6,3 @@ acteurs de l'inclusion numérique de la Métropole de Lyon. Pouvez-vous nous aid
<a href="<%= config.protocol %>://<%= config.host %><%= config.port ? ':' + config.port : '' %>/home?id=<%= id %>" <a href="<%= config.protocol %>://<%= config.host %><%= config.port ? ':' + config.port : '' %>/home?id=<%= id %>"
>cliquant ici</a >cliquant ici</a
>. >.
<br />
Cordialement,
<br />
L'équipe RES'in
<br />
<br />
Ce mail est un mail automatique. Merci de ne pas y répondre.
...@@ -6,10 +6,3 @@ plateforme pour accéder a votre structure en ...@@ -6,10 +6,3 @@ plateforme pour accéder a votre structure en
<a href="<%= config.protocol %>://<%= config.host %><%= config.port ? ':' + config.port : '' %>/register?id=<%= id %>" <a href="<%= config.protocol %>://<%= config.host %><%= config.port ? ':' + config.port : '' %>/register?id=<%= id %>"
>cliquant ici</a >cliquant ici</a
>. >.
<br />
Cordialement,
<br />
L'équipe RES'in
<br />
<br />
Ce mail est un mail automatique. Merci de ne pas y répondre.
...@@ -6,5 +6,3 @@ Afin de pouvoir vous connecter sur la plateforme, merci de cliquer sur ...@@ -6,5 +6,3 @@ Afin de pouvoir vous connecter sur la plateforme, merci de cliquer sur
>ce lien</a >ce lien</a
> >
afin de valider votre inscription<br /> afin de valider votre inscription<br />
<br />
Ce mail est un mail automatique. Merci de ne pas y répondre.
...@@ -23,6 +23,7 @@ export class MailerService { ...@@ -23,6 +23,7 @@ export class MailerService {
*/ */
public async send(to: string, subject: string, html: string): Promise<AxiosResponse<any>> { public async send(to: string, subject: string, html: string): Promise<AxiosResponse<any>> {
const formData = new FormData(); const formData = new FormData();
const data = JSON.stringify({ const data = JSON.stringify({
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
from_email: this.config.from, from_email: this.config.from,
...@@ -31,7 +32,7 @@ export class MailerService { ...@@ -31,7 +32,7 @@ export class MailerService {
to: [{ email: to }], to: [{ email: to }],
reply_to: 'inclusionnumerique@grandlyon.com', reply_to: 'inclusionnumerique@grandlyon.com',
subject: subject, subject: subject,
content: html, content: this.addSignature(html),
}); });
formData.append('metadata', data); formData.append('metadata', data);
const contentLength = formData.getLengthSync(); const contentLength = formData.getLengthSync();
...@@ -82,4 +83,17 @@ export class MailerService { ...@@ -82,4 +83,17 @@ export class MailerService {
} }
return JSON.parse(fs.readFileSync(jsonPath).toString()); return JSON.parse(fs.readFileSync(jsonPath).toString());
} }
/**
* Add site mail signature to a given html
* @param html
*/
public addSignature(html: string): string {
html += `<br /><br /><p>L’équipe projet inclusion numérique.</p><img src="${this.config.protocol}://${
this.config.host
}${
this.config.port ? ':' + this.config.port : ''
}/assets/logos/resin.jpg" alt="Logo resin" width="168" height="58"><br /><br /><p>Ce mail est un mail automatique. Merci de ne pas y répondre.</p>`;
return html;
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment