Skip to content

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

Closed
tcannonfodder wants to merge 1 commit intoexcid3:mainfrom
practical-computer:thomas/564-noticed-emails-kwargs
Closed

Fix Noticed::DeliveryMethods::Email to support keyword arguments#565
tcannonfodder wants to merge 1 commit intoexcid3:mainfrom
practical-computer:thomas/564-noticed-emails-kwargs

Conversation

@tcannonfodder
Copy link
Copy Markdown

@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
Copy Markdown
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.

@excid3 excid3 linked an issue Dec 19, 2025 that may be closed by this pull request
3 tasks
@excid3 excid3 closed this in e986c3c Dec 19, 2025
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.

[BUG] Noticed::DeliveryMethods::Email does not support keyword arguments

2 participants