-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1255 from etalab/feature/mjml_mails
Feature/mjml mails
- Loading branch information
Showing
66 changed files
with
1,916 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
insertFinalNewline: true | ||
indentStyle: space | ||
indentSize: 2 | ||
printWidth: 120 | ||
maxLineLength: 180 | ||
htmlWhitespaceSensitivity: ignore | ||
bracketSameLine: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,6 +76,8 @@ Naming/MethodParameterName: | |
- "_" | ||
- "nb" | ||
- "id" | ||
- "to" | ||
- "cc" | ||
|
||
Metrics/MethodLength: | ||
Max: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
app/mailers/api_entreprise/authorization_request_mailer.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
class APIEntreprise::AuthorizationRequestMailer < APIEntrepriseMailer | ||
include ExternalUrlHelper | ||
|
||
%w[ | ||
enquete_satisfaction | ||
embarquement_brouillon_en_attente | ||
embarquement_demande_refusee | ||
embarquement_modifications_demandees | ||
embarquement_relance_modifications_demandees | ||
embarquement_valide_to_editeur | ||
embarquement_valide_to_demandeur_tech_metier | ||
embarquement_valide_to_demandeur_seulement | ||
embarquement_valide_to_metier_cc_demandeur_tech | ||
embarquement_valide_to_demandeur_not_tech | ||
embarquement_valide_to_demandeur_tech_not_metier | ||
embarquement_valide_to_tech_cc_demandeur_metier | ||
embarquement_valide_to_tech_cc_metier | ||
demande_recue | ||
reassurance_demande_recue | ||
].each do |method| | ||
send('define_method', method) do |args| | ||
@all_scopes = I18n.t('api_entreprise.tokens.token.scope') | ||
@authorization_request = args[:authorization_request] | ||
@authorization_request_scopes = @authorization_request.token.scopes.map(&:to_sym) | ||
@authorization_request_datapass_url = datapass_authorization_request_url(@authorization_request) | ||
|
||
@full_name_demandeur = @authorization_request.demandeur.full_name | ||
@full_name_contact_technique = @authorization_request.contact_technique&.full_name | ||
@full_name_contact_metier = @authorization_request.contact_metier&.full_name | ||
|
||
mail(to: args[:to], cc: args[:cc], subject: t('.subject')) { |format| format.html } | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
class APIEntrepriseMailer < ApplicationMailer | ||
default from: 'support@entreprise.api.gouv.fr' | ||
|
||
default_url_options[:host] = Rails.env.production? ? 'https://entreprise.api.gouv.fr' : "https://#{Rails.env}.entreprise.api.gouv.fr" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
class APIParticulierMailer < ApplicationMailer | ||
default from: 'support@particulier.api.gouv.fr' | ||
|
||
default_url_options[:host] = Rails.env.production? ? 'https://particulier.api.gouv.fr' : "https://#{Rails.env}.particulier.api.gouv.fr" | ||
end |
27 changes: 27 additions & 0 deletions
27
app/views/api_entreprise/authorization_request_mailer/_banner_demande_valide.html.mjml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<mj-section mj-class="section-banner" background-color="#e3ebd3"> | ||
<mj-column> | ||
<mj-divider></mj-divider> | ||
<mj-text> | ||
<h1> | ||
<b> | ||
<% if entity == "editeur" %> | ||
Votre demande d'accès en tant qu'éditeur a été validée ✅ | ||
<% elsif entity == "contact_metier" || entity == "contact_technique" %> | ||
Votre service a désormais accès à l'API Entreprise ✅ | ||
<% else %> | ||
Votre demande d'accès a été validée ✅ | ||
<% end %> | ||
</b> | ||
</h1> | ||
<h2> | ||
<% if entity == "contact_metier"%> | ||
Vous avez été désigné contact métier. | ||
<% elsif entity == "contact_technique"%> | ||
Vous avez été désigné contact technique, récupérez le token 🔑 | ||
<% else %> | ||
Votre clé d'accès est disponible 🔑 | ||
<% end %> | ||
</h2> | ||
</mj-text> | ||
</mj-column> | ||
</mj-section> |
41 changes: 41 additions & 0 deletions
41
app/views/api_entreprise/authorization_request_mailer/_block_accelerer_demande.html.mjml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<mj-section mj-class="section-block"> | ||
<mj-column> | ||
<mj-text mj-class="block-beige"> | ||
<h2 style="margin-top: 10px"> | ||
<h3> | ||
ℹ️ Des supports pour étoffer votre demande et accélérer sa finalisation | ||
</h3> | ||
</h2> | ||
<p> | ||
⏱ | ||
<em>La majorité des demandes sont traitées en 10 jours.</em> | ||
<br /> | ||
⏳ | ||
<em>Les délais de traitement sont plus longs lorsqu’il nous manque des documents. </em> | ||
<br /> | ||
------ | ||
</p> | ||
<p> | ||
<b> | ||
Aidez-vous des contenus suivants pour étoffer votre dossier et accélérer le traitement de votre demande : | ||
</b> | ||
</p> | ||
<p> | ||
☑️ Préciser votre | ||
<b>cadre juridique</b> | ||
et fournir les justificatifs nécessaires, en vous aidant de notre rubrique | ||
<a target="_blank" href="<%= faq_index_url %>/#demande-d-habilitation"> | ||
"Demande d'habilitation - Quelles informations me seront demandées ?" | ||
</a> | ||
</p> | ||
<p> | ||
☑️ Identifier les | ||
<b>données</b> | ||
dont vous avez besoin, et ne sélectionner que celles strictement nécessaires pour votre service, en parcourant | ||
leur documentation dans le | ||
<a target="_blank" href="<%= endpoints_url %>/">"Catalogue des API"</a> | ||
</p> | ||
<p style="margin: 10px 0; margin-bottom: 10px"> </p> | ||
</mj-text> | ||
</mj-column> | ||
</mj-section> |
15 changes: 15 additions & 0 deletions
15
app/views/api_entreprise/authorization_request_mailer/_block_analytics.html.mjml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<mj-section background-color="#ffffff" padding="0px 40px 30px 40px"> | ||
<mj-column> | ||
<mj-text mj-class="block-beige"> | ||
<p> | ||
📊 | ||
<b>Pour être informé de la consommation de l'API Entreprise par vos services</b> | ||
connectez-vous à votre | ||
<a target="_blank" href="<%= user_profile_url %>"> | ||
<b>compte API Entreprise</b> | ||
</a> | ||
. | ||
</p> | ||
</mj-text> | ||
</mj-column> | ||
</mj-section> |
11 changes: 11 additions & 0 deletions
11
app/views/api_entreprise/authorization_request_mailer/_block_authorization_request.html.mjml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<mj-section mj-class="section-block"> | ||
<mj-column> | ||
<mj-text mj-class="block-beige"> | ||
<p> | ||
<b><%= authorization_request.intitule %></b> | ||
<br /> | ||
<%= authorization_request.description %> | ||
</p> | ||
</mj-text> | ||
</mj-column> | ||
</mj-section> |
33 changes: 33 additions & 0 deletions
33
app/views/api_entreprise/authorization_request_mailer/_block_help_demande.html.mjml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<mj-section mj-class="section-block"> | ||
<mj-column> | ||
<mj-text mj-class="block-beige"> | ||
<h3 style="margin-top: 10px">ℹ️ Des repères pour compléter votre demande</h3> | ||
<p> | ||
<i>Vous avez quelques doutes sur la façon de remplir votre demande d’habilitation ?</i> | ||
</p> | ||
<p> | ||
<b>Voici une liste des contenus utiles à consulter :</b> | ||
</p> | ||
<p> | ||
☑️ Vérifier votre éligibilité, en consultant notre rubrique | ||
<a target="_blank" href="https://api.gouv.fr/les-api/api-entreprise/demande-acces"> | ||
Un accès sous habilitation et conditions | ||
</a> | ||
</p> | ||
<p> | ||
☑️ Consulter le déroulé des étapes d’une demande, détaillé dans la rubrique | ||
<a target="_blank" href="<%= faq_index_url %>/#demande-d-habilitation"> | ||
“Demande d'habilitation - Quelles informations me seront demandées ?” | ||
</a> | ||
</p> | ||
<p> | ||
☑️ Identifier les données dont vous avez besoin, en parcourant le “ | ||
<a target="_blank" href="<%= endpoints_url %>/">Catalogue des API</a> | ||
</p> | ||
<p> | ||
☑️ Se rattacher à un cas d’usage identifié par API Entreprise, et utiliser un formulaire “pré-rempli” dans | ||
Datapass. | ||
</p> | ||
</mj-text> | ||
</mj-column> | ||
</mj-section> |
15 changes: 15 additions & 0 deletions
15
app/views/api_entreprise/authorization_request_mailer/_block_mise_en_production.html.mjml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<mj-section mj-class="section-block"> | ||
<mj-column> | ||
<mj-text mj-class="block-beige"> | ||
<h2> | ||
Pour mettre en production API Entreprise : | ||
</h2> | ||
<p> | ||
Utilisez notre kit de mise en production. Nous vous y listons les étapes pour intégrer l'API Entreprise : | ||
</p> | ||
</mj-text> | ||
<mj-button mj-class="block-beige" href="<%= developers_url %>#kit-de-mise-en-production"> | ||
Kit de mise en production 🚀 | ||
</mj-button> | ||
</mj-column> | ||
</mj-section> |
15 changes: 15 additions & 0 deletions
15
app/views/api_entreprise/authorization_request_mailer/_block_newsletter.html.mjml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<mj-section mj-class="section-block"> | ||
<mj-column> | ||
<mj-text mj-class="block-blue"> | ||
<p> | ||
🔔 | ||
<b> | ||
Pour connaître l'ensemble des lettres d'informations et notifications d'API Entreprise, vous pouvez consulter | ||
</b> | ||
<a target="_blank" href="<%= newsletter_url %>"> | ||
<b>cette rubrique.</b> | ||
</a> | ||
</p> | ||
</mj-text> | ||
</mj-column> | ||
</mj-section> |
17 changes: 17 additions & 0 deletions
17
app/views/api_entreprise/authorization_request_mailer/_block_questions.html.mjml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<mj-section mj-class="section-block"> | ||
<mj-column> | ||
<mj-text mj-class="block-beige"> | ||
<p> | ||
<b>Une question sur une donnée en particulier ?</b><br/> | ||
Parcourez le | ||
<a target="_blank" href="<%= endpoints_url %>/">catalogue des API</a> | ||
toute la documentation liée aux données s’y trouve. | ||
</p> | ||
<p> | ||
<b>Une interrogation d’ordre générale ?</b></br> | ||
Nous répondons à vos questions à la page | ||
<a target="_blank" href="<%= faq_index_url %>">FAQ</a> | ||
</p> | ||
</mj-text> | ||
</mj-column> | ||
</mj-section> |
46 changes: 46 additions & 0 deletions
46
...views/api_entreprise/authorization_request_mailer/_block_refusal_might_be_error.html.mjml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<mj-section mj-class="block-section"> | ||
<mj-column> | ||
<mj-text mj-class="block-beige"> | ||
<h2>🖐 Vous pensez qu’il s’agit d’une erreur ?</h2> | ||
<p> | ||
Nous vous invitons à consulter les contenus suivants, votre dossier ayant probablement été refusé pour ces | ||
raisons : | ||
</p> | ||
<ul> | ||
<li> | ||
<b>Vous ne faîtes pas partie des organisations éligibles,</b> | ||
vérifiez votre éligibilité | ||
<a target="_blank" href="https://api.gouv.fr/les-api/api-entreprise/demande-acces">ici</a> | ||
. | ||
</li> | ||
<li> | ||
<b>Votre cadre juridique ne démontre pas la légitimité de votre demande,</b> | ||
nous détaillons les éléments nécessaires pour remplir la demande d'habilitation dans la rubrique | ||
<a target="_blank" href="<%= faq_index_url %>/#demande-d-habilitation"> | ||
"Demande d'habilitation - Quelles informations me seront demandées ?" | ||
</a> | ||
de notre FAQ. | ||
</li> | ||
<li> | ||
<b>Les données demandées ne sont pas justifiées</b> | ||
par la nature de votre service. Pour circonscrire le périmètre de votre demande, vous pouvez vous aider du | ||
<a target="_blank" href="<%= endpoints_url %>"> | ||
<span>catalogue des API</span> | ||
</a> | ||
et des cas d’usage. | ||
</li> | ||
<li> | ||
<b>Votre demande est en attente depuis plus de trois mois.</b> | ||
Cette dernière est restée en brouillon ou bien les demandes d'informations additionnelles de l'instructeur | ||
n'ont fait l'objet d'aucune réponse de votre part. | ||
</li> | ||
</ul> | ||
<p> | ||
<span> | ||
En dernier recours, vous pouvez nous recontacter pour demander une révision de votre dossier depuis notre | ||
</span> | ||
<a target="_blank" href="<%= faq_index_url %>">page FAQ et support.</a> | ||
</p> | ||
</mj-text> | ||
</mj-column> | ||
</mj-section> |
18 changes: 18 additions & 0 deletions
18
app/views/api_entreprise/authorization_request_mailer/_block_subscribed_newsletter.html.mjml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<mj-section mj-class="section-block"> | ||
<mj-column> | ||
<mj-text mj-class="block-blue"> | ||
<h3> | ||
🔔 Lettres d'informations et notifications | ||
</h3> | ||
<p> | ||
<b>Vous êtes par défaut abonné à nos lettres d'informations.</b> | ||
<br /> | ||
Pour être informé des maintenances et des incidents de l'API Entreprise, abonnez-vous dès maintenant depuis | ||
notre page d'état des API : | ||
<a target="_blank" href="https://api-entreprise.instatus.com/"> | ||
<b><u>api-entreprise.instatus.com</u></b> | ||
</a> | ||
</p> | ||
</mj-text> | ||
</mj-column> | ||
</mj-section> |
12 changes: 12 additions & 0 deletions
12
app/views/api_entreprise/authorization_request_mailer/_button_login.html.mjml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<mj-button> | ||
<% if entity == "editeur" %> Se connecter au compte API Entreprise | ||
<br /> | ||
et récupérer/transmettre ma clé d'accès 🔑 <% else %> Se connecter | ||
<br /> | ||
au compte API Entreprise <% end %> | ||
</mj-button> | ||
<mj-text> | ||
<p> | ||
<a target="_blank" href="<%= login_url %>"><%= login_url %></a> | ||
</p> | ||
</mj-text> |
9 changes: 9 additions & 0 deletions
9
app/views/api_entreprise/authorization_request_mailer/_embarquement_valide_welcome.html.mjml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<mj-text mj-class="section-block"> | ||
<p> | ||
<b>Bienvenue</b> | ||
et à bientôt 🤝 | ||
</p> | ||
<p> | ||
<b>API Entreprise</b> | ||
</p> | ||
</mj-text> |
Oops, something went wrong.