Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
As a user I want to be able to create a contact form, add multiple email fields and set up emails to be sent to any of those fields.
Comments
Comment #2
scott_euser CreditAttribution: scott_euser at Fat Beehive commentedHi Kris,
Thanks for raising the issue. I will try to take a look as soon as I can.
If you are a coder and keen on looking into it yourself, it'll likely be here: http://cgit.drupalcode.org/contact_emails/tree/src/ContactEmailerService...
Which calls the Drupal Core Message getSenderMail method from here.
I assume you still have the default email field showing on your field? Perhaps wise I add a validation for that in case as I suppose it's possible to remove it with a form alter.
Thanks,
Scott
Comment #3
blueblot CreditAttribution: blueblot commentedHi Scott
I created a new form from Core contact. In there I placed some extra fields. My mailfield is field_mail.
Perhaps this would help?
I'm no coder, otherwise I would be glad to help sort this out.
Kris
Comment #4
scott_euser CreditAttribution: scott_euser at Fat Beehive commentedHi Kris,
When you go to your form and go to manage form display, there should be a field 'Sender email': that is the one that comes from the module doesn't yet support using a different field other than the built-in sender email field, but it shouldn't be too hard to add. I'll try to add it over the next couple of days; instead if you can make sure you're using the built-in sender email field for now it should work.
Thanks,
Scott
Comment #5
blueblot CreditAttribution: blueblot commentedHi Scott
thx, this works like you planned it. Super.
Can you take a look at the token support too? I tried to add some custom fields to the body from token support, but this doesn't work.
Maybe I should create a new issue for this?
Hope to help you.
thx.
Kris
Comment #6
scott_euser CreditAttribution: scott_euser at Fat Beehive commentedGlad that helped! Yeah if you could open another issue with perhaps a screenshot from manage fields and the body field of your email that would help.
Thanks,
Scott
Comment #7
scott_euser CreditAttribution: scott_euser at Fat Beehive commentedAs a user I want to be able to create a contact form, add multiple email fields and set up emails to be sent to any of those fields.
Comment #8
scott_euser CreditAttribution: scott_euser at Fat Beehive commentedComment #9
broonAny progress on that? I would be interested in that function as well.
I would even like to go as far as providing a settings option to select the field from the Contact form containing the email. Or even going further, not only list email fields but reference fields as well.
That way, you could create a content type "team" which describes various team members. This CT has an email field containing the team member's email address. In a team contact form, you would add a field "team member" (reference to nodes of type team) where the user can select a team member (s)he wants to get in contact with (the selection could btw be automated with Prepopulate module).
In the Contact Email settings, you would define the "team member" field as recipient, so the contact message gets always send to the team member selected in the contact form.
Comment #10
scott_euser CreditAttribution: scott_euser at Fat Beehive commentedHi Paul,
Sorry I haven't gotten to it yet, there were a few more critical issues. I don't think I'll bring in via reference on my own but if you're willing to contribute it as a patch I'd be happy to review and merge it in. If you are willing, perhaps best to wait until I finish adding the basic feature of selection of any email form field and patch on top of that.
Thanks,
Scott
Comment #11
broonI will. I already looked into the code but being fairly new to D8, I am not sure how to get all the available fields from the respective contact form in a proper way. If I had access to that, it shouldn't be to hard to get either the email field directly from the form submission or from a referenced entity.
Comment #12
scott_euser CreditAttribution: scott_euser at Fat Beehive commentedSounds good, I am almost there with it, made some good progress yesterday and have the upgrade path set up.
Thanks,
Scott
Comment #14
scott_euser CreditAttribution: scott_euser as a volunteer and at Fat Beehive commentedThis is now implemented, you can now select from an email field (including a repeating email field) from 8.x-1.5 onwards.
Paul, I have added your feature request as a new issue: https://www.drupal.org/node/2833627