-
-
Notifications
You must be signed in to change notification settings - Fork 162
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 #95 from useplunk/dev-driaug-sender-details-overwrite
Feat: Added ability to overwrite sender details
- Loading branch information
Showing
12 changed files
with
268 additions
and
29 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 |
---|---|---|
|
@@ -41,6 +41,9 @@ export class Tasks { | |
let subject = ""; | ||
let body = ""; | ||
|
||
let email = ""; | ||
let name = ""; | ||
|
||
if (action) { | ||
const { template, notevents } = action; | ||
|
||
|
@@ -52,6 +55,9 @@ export class Tasks { | |
} | ||
} | ||
|
||
email = project.verified && project.email ? template.email ?? project.email : "[email protected]"; | ||
name = template.from ?? project.from ?? project.name; | ||
|
||
({ subject, body } = EmailService.format({ | ||
subject: template.subject, | ||
body: template.body, | ||
|
@@ -62,6 +68,9 @@ export class Tasks { | |
}, | ||
})); | ||
} else if (campaign) { | ||
email = project.verified && project.email ? campaign.email ?? project.email : "[email protected]"; | ||
name = campaign.from ?? project.from ?? project.name; | ||
|
||
({ subject, body } = EmailService.format({ | ||
subject: campaign.subject, | ||
body: campaign.body, | ||
|
@@ -75,8 +84,8 @@ export class Tasks { | |
|
||
const { messageId } = await EmailService.send({ | ||
from: { | ||
name: project.from ?? project.name, | ||
email: project.verified && project.email ? project.email : "[email protected]", | ||
name, | ||
email, | ||
}, | ||
to: [contact.email], | ||
content: { | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -120,8 +120,8 @@ export class ActionService { | |
|
||
const { messageId } = await EmailService.send({ | ||
from: { | ||
name: project.from ?? project.name, | ||
email: project.verified && project.email ? project.email : "[email protected]", | ||
name: action.template.from ?? project.from ?? project.name, | ||
email: project.verified && project.email ? action.template.email ?? project.email : "[email protected]", | ||
}, | ||
to: [contact.email], | ||
content: { | ||
|
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
Oops, something went wrong.