`ActionMailbox::Base#bounce_with` enqueues the bounce email. For
situations where it is preferable to skip the email queues, this
commit introduces `#bounce_now_with`, which sends the bounce email
immediately (like `deliver_now` vs. `deliver_later`).
# Delivers the email immediately
MyMailbox.bounce_now_with MyMailer.my_method(args)
Also add some additional words to make it clear that the modules also
implement handling the exceptions configured with rescue_from, because
it was not immediately clear that happened without reading the code.
Currently when opening the main framework pages there is no introduction
to the framework. Instead we only see a whole lot of modules and the
`gem_version` and `version` methods.
By including the READMEs using the `:include:` directive each frameworks
has a nice introduction.
For markdown READMEs we need to add the :markup: directive.
[ci-skip]
Co-authored-by: zzak <zzakscott@gmail.com>
All the common rails commands and some extended commands use the
infinitive form for the verb in the description. This changes the
remaining tasks to use the infinitive form verb as well, for
consistency.
__Before__
```console
$ bin/rails --help
...
action_mailbox:install Installs Action Mailbox and its dependencies
...
app:template Applies the template supplied by LOCATION=(/path/to/template) or URL
...
credentials:diff Enrolls/disenrolls in decrypted diffs of credentials using git
credentials:edit Opens the decrypted credentials in `$EDITOR` for editing
credentials:show Shows the decrypted credentials
db:create Creates the database from DATABASE_URL or config/database.yml for the current RAILS_ENV (use...
db:drop Drops the database from DATABASE_URL or config/database.yml for the current RAILS_ENV (use d...
...
db:fixtures:load Loads fixtures into the current environment's database
db:migrate Migrate the database (options: VERSION=x, VERBOSE=false, SCOPE=blog)
db:migrate:down Runs the "down" for a given migration VERSION
db:migrate:redo Rolls back the database one migration and re-migrates up (options: STEP=x, VERSION=x)
db:migrate:up Runs the "up" for a given migration VERSION
db:prepare Runs setup if database does not exist, or runs migrations if it does
db:reset Drops and recreates all databases from their schema for the current environment and loads th...
db:rollback Rolls the schema back to the previous version (specify steps w/ STEP=n)
db:schema:cache:clear Clears a db/schema_cache.yml file
db:schema:cache:dump Creates a db/schema_cache.yml file
db:schema:dump Creates a database schema file (either db/schema.rb or db/structure.sql, depending on `ENV['...
db:schema:load Loads a database schema file (either db/schema.rb or db/structure.sql, depending on `ENV['SC...
db:seed Loads the seed data from db/seeds.rb
db:seed:replant Truncates tables of each database for current environment and loads the seeds
db:setup Creates all databases, loads all schemas, and initializes with the seed data (use db:reset t...
db:system:change Changes `config/database.yml` and your database gem to the target database
db:version Retrieves the current schema version number
destroy Removes code generated by `bin/rails generate`
dev:cache Toggles development mode caching on/off
encrypted:edit Opens the decrypted file in `$EDITOR` for editing
encrypted:show Shows the decrypted contents of the file
...
log:clear Truncates all/specified *.log files in log/ to zero bytes (specify which logs with LOGS=test...
middleware Prints out your Rack middleware stack
notes Shows comments in your code annotated with FIXME, OPTIMIZE, and TODO
...
routes Lists all the defined routes
runner Runs Ruby code in the context of your application
...
secrets:edit Opens the secrets in `$EDITOR` for editing
secrets:show Shows the decrypted secrets
...
tmp:create Creates tmp directories for cache, sockets, and pids
version Shows the Rails version
...
zeitwerk:check Checks project structure for Zeitwerk compatibility
```
__After__
```console
$ bin/rails --help
...
action_mailbox:install Install Action Mailbox and its dependencies
...
app:template Apply the template supplied by LOCATION=(/path/to/template) or URL
...
credentials:diff Enrolls/disenrolls in decrypted diffs of credentials using git
credentials:edit Opens the decrypted credentials in `$EDITOR` for editing
credentials:show Shows the decrypted credentials
db:create Create the database from DATABASE_URL or config/database.yml for the current RAILS_ENV (use ...
db:drop Drop the database from DATABASE_URL or config/database.yml for the current RAILS_ENV (use db...
...
db:fixtures:load Load fixtures into the current environment's database
db:migrate Migrate the database (options: VERSION=x, VERBOSE=false, SCOPE=blog)
db:migrate:down Run the "down" for a given migration VERSION
db:migrate:redo Roll back the database one migration and re-migrate up (options: STEP=x, VERSION=x)
db:migrate:status Display status of migrations
db:migrate:up Run the "up" for a given migration VERSION
db:prepare Run setup if database does not exist, or run migrations if it does
db:reset Drop and recreate all databases from their schema for the current environment and load the s...
db:rollback Roll the schema back to the previous version (specify steps w/ STEP=n)
db:schema:cache:clear Clear a db/schema_cache.yml file
db:schema:cache:dump Create a db/schema_cache.yml file
db:schema:dump Create a database schema file (either db/schema.rb or db/structure.sql, depending on `ENV['S...
db:schema:load Load a database schema file (either db/schema.rb or db/structure.sql, depending on `ENV['SCH...
db:seed Load the seed data from db/seeds.rb
db:seed:replant Truncate tables of each database for current environment and load the seeds
db:setup Create all databases, load all schemas, and initialize with the seed data (use db:reset to a...
db:system:change Change `config/database.yml` and your database gem to the target database
db:version Retrieve the current schema version number
destroy Remove code generated by `bin/rails generate`
dev:cache Toggle development mode caching on/off
encrypted:edit Open the decrypted file in `$EDITOR` for editing
encrypted:show Show the decrypted contents of the file
...
log:clear Truncate all/specified *.log files in log/ to zero bytes (specify which logs with LOGS=test...
middleware Print out your Rack middleware stack
notes Show comments in your code annotated with FIXME, OPTIMIZE, and TODO
...
routes List all the defined routes
runner Run Ruby code in the context of your application
...
secrets:edit Open the secrets in `$EDITOR` for editing
secrets:show Show the decrypted secrets
...
tmp:create Create tmp directories for cache, sockets, and pids
version Show the Rails version
...
zeitwerk:check Check project structure for Zeitwerk compatibility
```
Co-authored-by: Jonathan Hefner <jonathan@hefner.pro>
Previously, trying to `require "action_mailbox"` would fail if Active
Support was not previously required.
This fixes requiring Action Mailbox by adding the standard
"active_support" and "active_support/rails" requires. In addition, this
files uses `30.days` and so it needs to require core_ext/numeric/time as
well.
`Mail` gem is an external gem and all methods extended by Rails
are undocumented. However it's listed in API document page.
It serves no purposes so it should be removed.
Since engine initializers run later in the process, we need to run this
initializer earlier than the default.
This ensures they're all registered before the environments are loaded.
This commit adds `ActionMailbox.deprecator`, and adds it to
`Rails.application.deprecators` so that it can be configured via
settings such as `config.active_support.report_deprecations`.
RDoc will automatically format and link API references as long as they
are not already marked up as inline code.
This commit removes markup from various API references so that those
references will link to the relevant API docs.
"Overwrite" means "destructively replace", and is more suitable when,
for example, talking about writing data to a location.
"Override" means "supersede", and is more suitable when, for example,
talking about redifining methods in a subclass.
This is imperfect in situations when a separation
between regular files (such as uploads) and emails
is necessary (for the purposes of regulatory compliance,
proper compartmentalization, etc.)
Solution: allow configuring ActionMailbox's storage service
Generators generate things, but what is meant by 'Stubbing out' might
confuse beginners and non-native English speakers.
While generated tests are stubs that should have an implementation, a
generated model is a valid model that doesn't require any changes.
Forward ActionMailbox install to install generator and hide the ActionMailbox install generator from generator list
Updated the Action Mailbox install task description
Allow passing a block to the create_inbound_email_from_mail and
receive_inbound_email_from_mail test helper methods.
When you wanted to test a multipart email -- for example, an email that
has both a plaintext part and an HTML part -- there wasn't a way to
easily build one without a pre-made fixture. By allowing you to pass a
block to these methods, we unlock the power of Mail.new to easily
create a variety of emails, from multi-part emails, to emails with
attachments, and beyond.
Currently, the only exposed entry point into the ApplicationMailbox's configured
routing system is to call `route`, which performs a lot of work to fully
`process` inbound email. It'd be nice to have a way (e.g. in test) of checking
which mailbox an email would route to without necessarily processing it yet.
`receive_inbound_email_from_source` should accept an argument list
(`*args`) instead, to allow for the `source` argument in
`create_inbound_email_from_source`.
```ruby
receive_inbound_email_from_source(source, status: :processing)
```
Accepting a keyword argument list (`**kwargs`) results in an
`ArgumentError`
```text
ArgumentError: wrong number of arguments (given 1, expected 0)
```