Skip to content

Commit

Permalink
Add ### Extending Campaign Mailers with Macros to README
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-antonopoulos committed Apr 26, 2024
1 parent f30e5aa commit e684a0a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,23 @@ See the
[Rails documentation](https://api.rubyonrails.org/classes/ActiveSupport/Rescuable/ClassMethods.html#method-i-rescue_from)
for additional details.

### Extending Campaign Mailers with Macros

The campaign generator does not create a Mailer class for campaigns. In order to enhance a campaign
with a macro from another gem (such as for adding analytics), you can do so by extending the
`Heya::ApplicationMailer` class.

- Create a new file at `app/mailers/heya/application_mailer.rb`
- Add the following to it:

```
module Heya
class ApplicationMailer < ActionMailer::Base
macro_to_add_to_all_campaign_mailers
end
end
```

### Campaigns FAQ
**What happens when:**
<details><summary>I reorder messages in an active campaign?</summary>
Expand Down

0 comments on commit e684a0a

Please sign in to comment.