I am using the Entityform module with the Rules module.

When the user submit the form, an email notification is sent out. In the email notification, I want the FROM field to be the user's email address as opposed to the 'site-information' email address.

I couldn't set this with Rules in the Drupal Admin (I can only adjust the 'TO' field) How can I do that by code? or if you have any other idea to have the FROM field varies depending on the user's email address.



1 Answer 1


I finally figured it out. You can edit the "Send mail" component of the Entityform rules at: /admin/config/workflow/entity_rules/entityform_submission/manage/rules_entityform_notifications_email_send

Then specify the value of the FROM field from the replacement patterns. Keep in mind, when you build the form, or any new future forms, make sure that you always use the same field for the email and make it required. An empty email will result of the FROM field being sent from the site-wide admin email and not from the user's email. See image, hopefully it helps: FROM field of the entityform rules

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.