-
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat SES event-based email sendouts #1530
Conversation
a future note that to get expected overriding, have to use the initial array as the second entry in the plus operator + chain, strangely.
@Beagle Feel like giving a PR review? : D |
Ah, need to run with some of this functionality, but do check through @Beagle and give review and I’ll follow up. |
list($email, $display) = is_array($email_complex) ? | ||
[array_key_first($email_complex), reset($email_complex)] : | ||
[$email_complex, null]; | ||
$sanitized_email = filter_var($email, FILTER_SANITIZE_EMAIL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double check this against valid email addresses that have special characters. As an example, '
is a valid email character so you should be able to send to seamus.o'[email protected]
} | ||
|
||
/** | ||
* Email config validation, which should perhaps eventually be moved away from event lib |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is config? Saying "validateEmailIncomingConfig provides email config validation" is not a useful comment. Perhaps: "This validates email header information includes from, to, subject, etc"
return null; | ||
} | ||
|
||
function generateEmailEvent(array $config): array |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Returns a dictionary with the keys and data required to submit an event to the event bus"
@@ -79,47 +96,23 @@ public function setReplyTo($email_or_array) | |||
* | |||
* @return boolean whether the mail function accepted the inputs. | |||
*/ | |||
public function send() | |||
public function send($debug_override = false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
document the intention of debug_override
Super nice. A great bridgehead into getting an EDA in place. Nice job! |
Purpose of PR:
Fixes: #1230
End Result in my gmail:
Before
We were using a system based on exim4 on the server, and also relying on a phpmailer library in php that became deprecated and then removed.
After
Now we hook right in to SES via events. We could probably eventually use SES templates and other such things.
For Non-Hotfixes:
Attached Screenshot of my change:
Things that make review take longer:
(remove lines that do not apply to this PR)
Things that make review faster and easier:
(check box with an x where it applies)
Preview results in my branch at the url: