On the module description page, the first screenshot shows how to set a default email address by selecting a value from the webform. (This appears to be from Drupal 7.) I cannot find this setting anywhere in the Drupal 8 version of the module.

I'm testing with a fresh install:
Drupal 9.4.9
Webform 6.1.3
Webform Email Reply 2.0.2

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

markdc created an issue. See original summary.

martijn de wit’s picture

Status: Active » Closed (works as designed)

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

kurttrowbridge’s picture

Status: Closed (works as designed) » Active

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.

arunkumark’s picture

StatusFileSize
new214.41 KB
new171.44 KB

@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):
D7

Drupal 8+(Webform Email Reply 2.x):
D7

kurttrowbridge’s picture

Title: Where to set the default "to" email address » Add setting to provide default "to" email address
Version: 2.0.2 » 2.0.x-dev
Component: Documentation » Code
Category: Support request » Feature request
Status: Active » Needs review

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):

  1. 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.
  2. 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.
  3. 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!

martijn de wit’s picture

Is there a dependency on a specific version of webform in this change?

kurttrowbridge’s picture

(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.

arunkumark’s picture

Issue tags: +Novice

joelpittet made their first commit to this issue’s fork.

joelpittet’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Novice

Moving to RTBC because I have been testing the results and it's working well. I just did some light DI changes that were requested a while ago.

martijn de wit’s picture

thank you arunkumark & joelpittet!

To make things clear. Is it possible to add 2 images to the issue summary.

1 image before the change and 1 after ?

thank you in advance!

martijn de wit’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

joelpittet’s picture

@martijn de wit you might have noticed the before and after in comment #4. Thanks for committing it. Here's mine in D10 only to show it in action on the 3rd party settings and the result
Result to filled out
Settings

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.