We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10323
    • 35 Posts
    I tried the method described by Vincent to send Email to a recipient based on the user’s selection in the form. However, I keep getting failure notices from the mailer-daemon basically saying that the "to" address is invalid.

    I have, for testing purposes, put the same placeholder (’emailAddresses’) in the &emailSubject property, and there the Email-Address from the custom hook appears fine. Here is the FormIt call (my custom hook is called formRecipients):

    [[!FormIt?
      &hooks=`formRecipients,spam,email,redirect`
      &emailTo=`[[+emailAddresses]]`
      &emailTpl=`formContactEmail`
      &emailSubject=`Test - [[+emailAddresses]]`
      &redirectTo=`56`
      &validate=`workemail:blank,
        message:required:stripTags`
    ]]
    


    With the recipient address ’proper@emailaddress’ specified in the custom hook, that yields something like:

    To: [invalid email address]
    Subject: Test - proper@emailaddress

    Any ideas why the ’emailAddresses’ placeholder is correctly substituted in the ’subject’ but not in the ’to’ property?

    FormIt 1.6.0-rc1
    MODx 2.0.8-pl (traditional)