Skip to content

Commit

Permalink
feat: send magic link email with new ip
Browse files Browse the repository at this point in the history
  • Loading branch information
rdubigny committed Feb 8, 2024
1 parent 1c890c5 commit 2b94a41
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
4 changes: 1 addition & 3 deletions cypress/e2e/signin_with_magic_link.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ describe("sign-in with magic link", () => {
// extract the connection link from the email subject
.then((email) => {
const matches =
/.*<a style="text-decoration:none; color:#fff; font-weight:normal;" target="_blank" href="([^"]+)"><strong>Se connecter<\/strong><\/a>.*/.exec(
email.body,
);
/.*<a href="([^"]+)" class="r13-r default-button".*/.exec(email.body);
if (matches && matches.length > 0) {
return matches[1];
}
Expand Down
11 changes: 4 additions & 7 deletions src/connectors/brevo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@ import { BrevoApiError } from "../config/errors";
import { render } from "../services/renderer";
import { logger } from "../services/log";

type RemoteDeprecatedTemplateSlug =
| "join-organization"
| "verify-email"
| "magic-link";
type RemoteDeprecatedTemplateSlug = "join-organization" | "verify-email";
type RemoteTemplateSlug =
| "official-contact-email-verification"
| "choose-sponsor"
| "reset-password";
| "reset-password"
| "magic-link";
type LocalTemplateSlug =
| "organization-welcome"
| "unable-to-auto-join-organization"
Expand All @@ -30,7 +28,6 @@ const remoteTemplateSlugToBrevoDeprecatedTemplateId: {
} = {
"join-organization": 61,
"verify-email": 6,
"magic-link": 29,
};
const defaultBrevoDeprecatedTemplateId = 21;
const remoteTemplateSlugToBrevoTemplateId: {
Expand All @@ -39,8 +36,8 @@ const remoteTemplateSlugToBrevoTemplateId: {
"official-contact-email-verification": 3,
"choose-sponsor": 2,
"reset-password": 5,
"magic-link": 1,
// TODO: progressively uncomment these lines
// "magic-link": 1,
// "join-organization": 4,
// "verify-email": 6,
};
Expand Down

0 comments on commit 2b94a41

Please sign in to comment.