- 🇳🇱Netherlands Martijn de Wit 🇳🇱 The Netherlands
It seems that this is the Site e-mail adres in the 2.x version
You can find this under /admin/config/system/site-information/ -> E-mail.
$default_from_email = \Drupal::config('system.site')->get('mail');
webform_email_reply/src/Form/WebformEmailReplyForm.php
- Status changed to Active
7 months ago 9:11pm 12 June 2024 - 🇺🇸United States kurttrowbridge
That's true for the From: value (who's sending the email), but I think the original request was about the To: value (who's receiving it)—and I actually just came looking for that this week as well. Ideally, I would think you'd be able to either enter a token that would fill in the value from the Webform submission, or you'd get to choose on a per-form basis which Email field from the form gets used.
- 🇮🇳India arunkumark Coimbatore
@KurtTrowbridge @markdc
In Drupal 7, the webform module provided the option to select the From address field from the existing Webform. But now latest version(Webform Email Reply 2.x) the From address approach has been changed.
By default, the current website email address will be added as
From
address. To address is always open for the user to enter. It same as Drupal 7.Drupal 7(Webform Email Reply 2.x):
Drupal 8+(Webform Email Reply 2.x):
- Merge request !6Updated reply email recipient field to include token support and default email... → (Open) created by kurttrowbridge
- 🇺🇸United States kurttrowbridge
Hello again—I created a merge request with a couple additions based on this issue (so I'm also switching it to a feature request and modifying the title):
- The Email field on the reply form now has support for tokens, so you can enter the token for an email field as the value.
- If a Webform has at least one Email field, it now has a third-party setting (see
/admin/structure/webform/manage/{webform}/settings
) where you can specify the default recipient field for replies sent for that form's submissions. - If a default field is set, the Email field is disabled and automatically filled in with the default field's value, but the reply form has a new checkbox so that it be customized beyond the default. (As I write this up now, I'm starting to wonder if that's overkill; maybe the default value just gets filled in, but the field remains enabled for further editing, and there's no checkbox at all. Open to feedback on that.)
I did what I think was a decent amount of testing—sending replies to both a hardcoded email address and a token, confirming nothing breaks when the Webform has no email fields, confirming nothing breaks when the submission didn't use the default field—but would appreciate additional reviews or feedback. Thanks!
- 🇳🇱Netherlands Martijn de Wit 🇳🇱 The Netherlands
Is there a dependency on a specific version of webform in this change?
- 🇺🇸United States kurttrowbridge
(After thinking on it over the weekend, I decided the checkbox I introduced to customize the email when a default was set was overly complex—I removed it, so the Email field just has a default value if the submission has a value for the selected field, and is empty otherwise.)
re: #7, no, I don't think so—third-party settings are a Drupal core feature and (despite this being my first time having used them myself) have been around since D8. Nothing else in my MR requires any specific Webform functionality.