Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Email Plugin Does Not Accept RFC 5322 Mailbox Format in site.yaml #3905

Open
thekenshow opened this issue Feb 19, 2025 · 0 comments
Open

Email Plugin Does Not Accept RFC 5322 Mailbox Format in site.yaml #3905

thekenshow opened this issue Feb 19, 2025 · 0 comments

Comments

@thekenshow
Copy link
Contributor

With the RFC 5322 standard mailbox John Doe <[email protected]> address stored in site.yaml as follows:

form_email:
    myaddress: "John Doe <[email protected]>"

And the form configured as follows:

email:
        -
            subject: '[Contact] from {{ form.value.name|e }}'
            body: '{% include ''forms/data.html.twig'' %}'
            to: '{{ config.site.form_email.myaddress|e }}'
            to_name: 'Contact'
            reply_to: '{{ form.value.email|e }}'

The email is not sent. If I modify the mailbox address to just [email protected]> like so:

form_email:
    myaddress: [email protected]

The email is sent.

Note that the form submission is being processed asynchronously with the following:

<script>
$(document).ready(function(){

    var form = $('#contact-form'); 
    form.submit(function(e) {
        // prevent form submission
        e.preventDefault();
        
        // Start spinner here?
        document.getElementById('contact-spinner').setAttribute('class', 'visible');

        // submit the form via Ajax
        $.ajax({
            url: form.attr('action'),
            type: form.attr('method'),
            dataType: 'html',
            data: form.serialize(),
            success: function(result) {
                // Inject the result in the HTML
                $('#form-result').html(result);
            }
        });
       
        // scroll to message region
        document.getElementById('myIdLocation').scrollIntoView({
          behavior: 'smooth'
        });
    });
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant