-
-
Save j-manu/ada57a930473c4d25e85e03b5132683d to your computer and use it in GitHub Desktop.
Revisions
-
leastbad revised this gist
Feb 8, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ class IncomingMailbox < ApplicationMailbox # before_processing do # unless User.exist?(email: mail.from) # bounce_with Mailer.user_not_found(mail) # end # end -
leastbad revised this gist
Jan 10, 2020 . 1 changed file with 5 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ This is all you really need to know in order to make Action Mailbox work in development. 1. Fire up `ngrok http 3000` and make note of your subdomain for steps 3 and 8. 2. Create a Mailgun account because they offer sandbox addresses; grab your domain from the Dashboard. 3. Go into Receiving and create a catch-all route pointing to: `https://XXX.ngrok.io/rails/action_mailbox/mailgun/inbound_emails/mime` 4. Add your Mailgun API key to your credentials: @@ -21,6 +21,7 @@ action_mailbox: ``` 9. Make sure your `config/sidekiq.yml` is monitoring the `action_mailbox_routing` queue. 10. Configure your `application_mailbox.rb` with whatever routing you need; example below. 11. Configure your `incoming_mailbox.rb` as you wish; example below. You should now be able to send an email to test@MAILGUN-SANDBOX-DOMAIN. -
leastbad revised this gist
Jan 10, 2020 . 1 changed file with 0 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -9,8 +9,6 @@ class IncomingMailbox < ApplicationMailbox # end # end def process # puts mail.methods - Object.methods # mail.content, mail.subject, mail.has_attachments? -
leastbad revised this gist
Jan 10, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -12,7 +12,7 @@ action_mailbox: 5. `rails action_mailbox:install` 6. `rake db:migrate` 7. `rails generate mailbox incoming` 8. Add the following to your `config/environments/development.rb` ``` -
leastbad revised this gist
Jan 10, 2020 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -23,3 +23,4 @@ action_mailbox: 9. Make sure your `config/sidekiq.yml` is monitoring the `action_mailbox_routing` queue. 10. Configure your `application_mailbox.rb` with whatever routing you need; example below 11. Configure your `incoming_mailbox.rb` as you wish; example below 12. You should now be able to send an email to test@MAILGUN-SANDBOX-DOMAIN. -
leastbad revised this gist
Jan 10, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ This is all you really need to know in order to make Action Mailbox work in development. 1. Fire up `ngrok http 3000` and make note of your subdomain for steps 3 and 8. 2. Create a Mailgun account because they offer sandbox addresses; grab your domain from the Dashboard 3. Go into Receiving and create a catch-all route pointing to: `https://XXX.ngrok.io/rails/action_mailbox/mailgun/inbound_emails/mime` 4. Add your Mailgun API key to your credentials: -
leastbad revised this gist
Jan 10, 2020 . 1 changed file with 6 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -7,15 +7,18 @@ This is all you really need to know in order to make Action Mailbox work in deve ``` # rails credentials:edit action_mailbox: mailgun_api_key: API KEY HERE ``` 5. `rails action_mailbox:install` 6. `rake db:migrate` 7. `rails generate mailbox` 8. Add the following to your `config/environments/development.rb` ``` config.action_mailbox.ingress = :mailgun config.hosts << "XXX.ngrok.io" ``` 9. Make sure your `config/sidekiq.yml` is monitoring the `action_mailbox_routing` queue. 10. Configure your `application_mailbox.rb` with whatever routing you need; example below -
leastbad created this gist
Jan 10, 2020 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ This is all you really need to know in order to make Action Mailbox work in development. 1. Fire up `ngrok http 3000` and make note of your subdomain for step 3. 2. Create a Mailgun account because they offer sandbox addresses; grab your domain from the Dashboard 3. Go into Receiving and create a catch-all route pointing to: `https://XXX.ngrok.io/rails/action_mailbox/mailgun/inbound_emails/mime` 4. Add your Mailgun API key to your credentials: ``` # rails credentials:edit action_mailbox: mailgun_api_key: API KEY HERE``` 5. `rails action_mailbox:install` 6. `rake db:migrate` 7. `rails generate mailbox` 8. Add the following to your `config/environments/development.rb` ``` config.action_mailbox.ingress = :mailgun config.hosts << "XXX.ngrok.io"``` 9. Make sure your `config/sidekiq.yml` is monitoring the `action_mailbox_routing` queue. 10. Configure your `application_mailbox.rb` with whatever routing you need; example below 11. Configure your `incoming_mailbox.rb` as you wish; example below This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,4 @@ class ApplicationMailbox < ActionMailbox::Base # routing /^info@/i => :incoming routing all: :incoming end This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ class IncomingMailbox < ApplicationMailbox # before_processing # around_processing # after_processing # before_processing do # unless User.exist?(email: mail.from) # bounce_with Mailer.user_not_found(mail).deliver_later # end # end # NOTE: Make sure sidekiq.yml is processing the action_mailbox_routing queue def process # puts mail.methods - Object.methods # mail.content, mail.subject, mail.has_attachments? puts mail.inspect end end