Commit Graph

17 Commits

Author SHA1 Message Date
Naz Gargol
c99f40957e
Improved mega error handling (#11393)
no issue

- Increased default mailgun retry limit to 5
- Handling retry logic closer to SDK layer gives less future manual handling
- Allowed failing request to be passed through to the caller
- To be able to handle failed requests more gracefully in the future we need all available error information to be given to the caller
- The previous method with `Promise.all` would have rejected a whole batch without providing details on each specific batch.
- Limited data returned with a failed message to batch values
- Added better error handling on mega layer
- Added new column to store failed batch info
- Added reference to mailgan error docs
- Refactored batch emailer to respond with instances of an object
- It's hard to reason about the response type of bulk mailer when multiple object types can be returned
- This gives more clarity and ability to check with `instanceof` check
2019-11-15 18:25:33 +07:00
Kevin Ansfield
90f61d1f04 Added 'bulk-email' tag to bulk messages sent with mailgun
no issue

- helps distinguish bulk vs transactional email when both are using the same mailgun account
2019-11-15 00:06:23 +00:00
Rish
dbae6ccb58 Added site title as sender name for bulk email
no issue
2019-11-14 20:39:51 +05:30
Nazar Gargol
98364e4d66 Removed unused method from bulk-mailer
- This was a leftover from rebase
- The method is not meant to be used anywhere
2019-11-14 12:35:26 +07:00
Rish
22b48cbef3 Fixed mailgun instance not updated on settings change
no issue
2019-11-14 10:45:26 +05:30
Rish
d3229b6ade Wired mailgun provider API keys via config or settings
no issue
2019-11-13 22:29:31 +05:30
Rish
af43c0872c Fixed mailgun not sending test emails due to empty recipient variables
no issue

Mailgun expects `recipient-variables` to be a json object and fails to attempt sending the message in case its undefined, which is the case for test emails as they don't have member `uuid` or `unsubscribe` url. This sets a default empty object for `recipent-variables` in case of no data.
2019-11-13 17:02:56 +05:30
Naz Gargol
f5479e1473
Added batching support for bulk email service (#11388)
no issue

- The limitation on Mailgun side of API seems to be 1000 emails per message.
- The only place where I could find a hard limit of 1000 emails per
batch was this PHP SDK issue: https://github.com/mailgun/mailgun-php/issues/469
- To store ids of sent messages introduce a mega column on the emails table. They can be synced with stats or other metrics during even pooling in the future
- Removed redundant `join(',')` statement.The SDK accepts an array of emails as well. Less code - better code :)
2019-11-13 17:52:23 +07:00
Naz Gargol
208b710677
Added tagging support to bul email service (#11390)
no issue

- Tagging needs to be added to be able to group/filter sent messages for various reasons. An example use case is when multiple Ghost instances use the same mailgun account
- Tag value can be provided as a part of config.json file under
`bulkEmail.mailgun.tag` key
2019-11-13 17:36:19 +07:00
Fabien O'Carroll
0a47adac88
Updated name of bulk email service config
no-issue
2019-11-08 17:26:05 +07:00
Fabien O'Carroll
11d0eff863 Converted bulk email service to use mailgun
no-issue
2019-11-08 17:21:20 +07:00
Rish
7b89cd445a Fixed unsubscribe url for preview email 2019-11-06 18:36:27 +07:00
Fabien O'Carroll
509682cd6a Supported unsubscribe_url template variable for bulk email
no-issue
2019-11-06 18:08:11 +07:00
Fabien O'Carroll
0689ae9657 Fixed JSDoc comments for bulk emailer
no-issue
2019-11-05 12:53:14 +07:00
Fabien O'Carroll
39688cef07 Fixed bulk-email service loop
no-issue
2019-11-04 13:23:49 +07:00
Fabien O'Carroll
8503105b39 Improved bulk email service
no-issue

Used proper logging
2019-11-04 13:01:58 +07:00
Fabien O'Carroll
20ce0c313c Added initial bulk-email service
no-issue

This is a simple wrapper around the current ghost mailer service for now
2019-11-04 12:36:12 +07:00