1

I have a webform on my site, which collects names and email addresses, for the purposes of receiving content updates. When a new piece of content of a specific content type is added, I want to be able to send the email addresses collected in that webform a message, letting them know that new content has been added.

I've been able to set up rules to send a notification to one specific email address. However, I am struggling with sending to the email values collected in the webform.

I've added the Webform Rules module, and have PHP Filter turned on. However, I'm unable to send. Any help, or PHP code to accomplish what I'm looking to accomplish would be greatly appreciated!

Thanks in advance!!

2
  • It's easier using Entity Form and Entity Complete also i recommend you use an email transactional service like mailgun.
    – ropic
    Commented Apr 28, 2016 at 5:26
  • Are you able to create a view from those submitted webforms, with 1 views result for each submission (and which includes those eMail Ids you want to use for yor eMail)? If so, piece of cake with Rules (let me know). Commented Jan 24, 2017 at 18:46

1 Answer 1

0

how about direct get data from database? If you add hidden field and the default value will be [current-page:query:sid]. Use php code to get the data. Example: $raw = db_query("SELECT AGE.data AS age FROM webform_submissions S LEFT JOIN webform_submitted_data A ON A.sid=S.sid AND A.cid=1 LEFT JOIN webform_submitted_data AGE ON AGE.sid=A.sid AND AGE.cid=2 where [current-page:query:sid] = A.sid)->fetchAll();

I dun know I have not tried to code yet. Hope its can help you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.