Forum for discussing general topics related to Couch.
2 posts Page 1 of 1
Hey there. I am gonna build a contact form and use php mail method( http://www.couchcms.com/forum/viewtopic.php?f=4&t=8675&p=16793&hilit=smtp+email#p16802 ) for it. Is there anyway to send email to multiple recipients based on selected option? For example when user choose "Support Department", mail will send to support@mysite.com?

Thank you so much and sorry for my bad English
If you can assign email to each department as opt_values in cms:input then once the form submits,
this value will be available as frm_mail_dpt, which therefore can be used as to value.
Sample:
Code: Select all
<cms:form ... >
...
<cms:if k_success >
  <cms:send_mail to=frm_mail_dpt ... />
...
</cms:if>

<cms:input name='mail_dpt' type='dropdown' opt_values='Please select recipient =- | Admin = admin@site.com | Support = support@site.com' />
<cms:input type='submit' name='submit' />

..
</cms:form>
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
2 posts Page 1 of 1