Skip to content

Conversation

@tcannonfodder
Copy link

@tcannonfodder tcannonfodder commented Oct 21, 2025

Pull Request

Summary:

Fix Noticed::DeliveryMethods::Email to support keyword arguments

Related Issue:

#564

Description:

  • Mailers with keyword arguments were not able to be used by the Noticed::DeliveryMethods::Email because the arguments were not double-splatted to convert a hash to the arguments the mailer expects
  • To support keyword arguments in mailers, while maintaining backward compatability with existing configurations, a new kwargs option is available
    • If present, the mailer will be called with public_send(name, **kwargs), to properly convert the hash of argument to keyword arguments as Ruby expects them
    • When delivering, kwargs and args cannot both be present, because only one can be used. In this case, an ArgumentError will be thrown

Testing:

  • Added unit tests for the new behavior, along with documentation for the new option

Checklist:

  • Code follows the project's coding standards
  • Tests have been added or updated to cover the changes
  • Documentation has been updated (if applicable)
  • All existing tests pass
  • Conforms to the contributing guidelines

* Mailers with keyword arguments were not able to be used by the
	`Noticed::DeliveryMethods::Email` because the arguments were not
	double-splatted to convert a hash to the arguments the mailer
	expects
* To support keyword arguments in mailers, while maintaining
	backward compatability with existing configurations, a new
	`kwargs` option is available
	* If present, the mailer will be called with
		`public_send(name, **kwargs)`, to properly convert the hash of
		argument to keyword arguments as Ruby expects them
	* When delivering, `kwargs` and `args` cannot both be present,
		because only one can be used. In this case, an `ArgumentError`
		will be thrown
* Added unit tests for the new behavior, along with documentation for
	the new option
@excid3
Copy link
Owner

excid3 commented Oct 23, 2025

Thanks @tcannonfodder! Surprised I forgot to add this haha.

There should be a way for us to pass both args and kwargs together. I'm going to see if I can figure out how to do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants