Write the message IDs to the message on successful send - #76
Conversation
WalkthroughThe Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used🧬 Code graph analysis (1)lib/mailtrap/action_mailer/delivery_method.rb (1)
🔇 Additional comments (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@ghiculescu a new version is released. Feel free to update the gem. |
When an email is sent, Mailtrap sends back a message ID. If you use the Mailtrap client directly you can get this ID back. But it's not easily accessible if using Action Mailer.
This makes it hard to connect an incoming webhook to the email that was sent.
This PR adds some extra code to the Action Mailer delivery method, to store the message ID as a header on the message.
In another project that uses Postmark, I saw code that did this:
Thanks to this in their gem: https://github.com/ActiveCampaign/postmark-gem/blob/a50ff395d04b1c0050d11ce0ece70543c31f7f8f/lib/postmark/api_client.rb#L390
This basically does the equivalent.
Summary by CodeRabbit