blakej115 / magic-forms

Create easy (and almost magic) AJAX forms
https://octobercms.com/plugin/blakejones-magicforms
MIT License
6 stars 4 forks source link

Email "0" does not comply with addr-spec of RFC 2822 when sending notification #4

Closed fossadierDorian closed 1 year ago

fossadierDorian commented 1 year ago

Hello, I found an error on the plugin. The problem is that the $properties["mail_recipients"] is an array, due to the fact that the value is registred with datatable widget (with old magic forms is was registered as a simple string).

The idea to change the widget type is good, but you have to create an associative array with the email as key. Actually the key is [0]. image

Thank you, Dorian

blakej115 commented 1 year ago

Hi @fossadierDorian,

Using the old format for the "mail_recipients" property will result in this error, below is an example of the old format:

[genericForm]
mail_recipients[] = "blakej115@gmail.com"
mail_recipients[] = "email@example.com"

Update these to use the email as the key and the name of the recipient as the value:

[genericForm]
mail_recipients[blakej115@gmail.com] = "Blake Jones"
mail_recipients[email@example.com] = "Example Person"

Please let me know if this clears things up or not. If I've misunderstood, please elaborate further.

Updated documentation that documents this, as well as a full upgrade guide are coming soon.

Thank you!