Skip to content

Can’t get multiple emails to work #188

@eattext

Description

@eattext

Thanks for all your work on this plugin. I’ve got the form on my website to work i.e. emails successfully sent and received on Submit using SMTP, but can’t make multiple emails work for some unknown reason.

The first method using two email process calls proceeds successfully to display: /formsubmit (confirmation page is shown with no errors), but only the first email (‘Copy to myself’) is sent:

    process:
        email:
            subject: "Copy to myself"
            body: "{% include 'forms/data.html.twig' %}"
            from: "{{ config.plugins.email.from }}"
            to: "{{ config.plugins.email.to }}"
        email:
            subject: "Copy to user"
            body: "{% include 'forms/data.html.twig' %}"
            from: "{{ config.plugins.email.from }}"
            to: "{{ form.value.email }}"
        display: /formsubmit

The second method, using the recommended syntax/array, doesn’t seem to proceed successfully to display: /formsubmit i.e. a slightly broken page (wrong template?) is displayed, but the first email (‘Copy to myself’) is successfully sent and received:

  process:
       email:
           - 
               subject: "Copy to myself"
               body: "{% include 'forms/data.html.twig' %}"
               from: "{{ config.plugins.email.from }}"
               to: "{{ config.plugins.email.to }}"
           - 
               subject: "Copy to user"
               body: "{% include 'forms/data.html.twig' %}"
               from: "{{ config.plugins.email.from }}"
               to: "{{ form.value.email }}"
       display: /formsubmit

Swapping positions of email blocks produces the same result i.e. first email only sent (this time, ‘Copy to user’), suggesting that there’s nothing wrong with the variables.

Same result if using Sendmail instead of SMTP. PHP is version 8.2.

Any idea on what the problem is here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions