Custom From Address Defined in Webform Module Ignored in Favor of Site Information's From Email Address

Created on 3 September 2015, over 9 years ago
Updated 27 September 2023, about 1 year ago

Problem

We were using verson 7.x-1.1 with Webforms, making use of a feature in Webforms (found in Webforms tab, then email button) which allowed for custom email "from addresses" that were not the email address defined on the Site Information Page (Configuration | System | Site information). These email addresses were set up correctly on postmarkapp.com The form sends the form contents to a designation address and the user who filled out the form. Examining the email header confirms the "from address".

After moving the site to a new server and installing 7.x-1.2 we found that the custom from addresses were being ignored, instead the from address defined in the Site Information page was always used.

We dug into the current Postmark module and discovered that no matter what you gave it, it was setting the From address to the site default address.
In the first line, it's setting the sender variable to be the email address it was given (i.e. $address is the one specified in webform, customerservice). Then it ignores it, and just sets From to be the site email.

$sender = $address[0]['mail']; <-- this is the given 'from' address, i.e. customerservice@wcirb
$from = variable_get('site_mail'); <-- this is the site email address
$postmark_mail->from($from); <-- this sets the 'from' to be the site email

So we checked out the version of the module that we had last October, and that was different. In that one, it's setting the From Address to be 'sender', or the proper one that was given to it.

$sender = $address[0]['mail'];
$from = variable_get('site_mail');
$postmark_mail->from($sender); <-- this sets the 'from' to be the passed-in address

Repeatable: Always

Steps to Repeat

1. Set up a Webform to send contents to the user who filled out the form.
2. Define a custom "from Address" that is registered/validated on postmarkapp.com and different from the email address defined on the site information page.
3. Process a form, examine the email header.

Drupal: 7.39
Hosted on Acquia

πŸ› Bug report
Status

Active

Version

1.2

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States HenryS

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024