Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Rasmus Fjord 675 posts 1566 karma points c-trib
    Apr 16, 2021 @ 11:38
    Rasmus Fjord
    0

    Adding multiple emails to BCC field

    Hey! :)

    I was trying to add trust pilot to our email sendout, on the BCC field. We already had 1 email going out on the BCC field, so i wanted to add another. So I added it like this :

    [email protected];[email protected]

    And when i hit save it just shows up with a validation star next to the field, and removes my second email. So its never saved. I then figured out that because trustpilot emails are like this : [email protected]

    The plus makes it hit validation and wont work, and the mail dosnt get send out :(

    Any ideas here? Ive also tried adding the email directly to the bcc field in the database, but it wont send to both anyways.

    TC version is 3.3.1 so dont know its fixed in a small bump.

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Apr 16, 2021 @ 12:34
    Matt Brailsford
    0

    Hey Ramus,

    Hmm, I guess our validation logic for what constitutes an email address is possibly too strict, though I would potentially have expected adding it to the db to have worked. Did you see any errors in your log?

    Matt

  • Rasmus Fjord 675 posts 1566 karma points c-trib
    Apr 16, 2021 @ 17:29
    Rasmus Fjord
    0

    No when i tested it i went checking the logs to make sure nothing popped up in there, but no errors at all, so I thought the DB fix had worked actually.

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Apr 16, 2021 @ 18:40
    Matt Brailsford
    0

    Hmm, interesting.

    Could you try it comma separated instead of ‘;’? Worth a try.

    Matt

  • Rasmus Fjord 675 posts 1566 karma points c-trib
    Apr 16, 2021 @ 20:20
    Rasmus Fjord
    0

    Yeah just tried it no luck but if I remove the "+" sign in the email it will save just fine.

    So im guessing its comming down to that. Maybe on the email sendoff there is a sanity check on the emails entered or some regex check where the email fails it.

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Apr 17, 2021 @ 05:41
    Matt Brailsford
    1

    Hmmm, ok. Let me check this on Monday 🤔

  • Rasmus Fjord 675 posts 1566 karma points c-trib
    Apr 19, 2021 @ 05:58
    Rasmus Fjord
    0

    Sure thing ✌️✌️

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Apr 19, 2021 @ 08:34
    Matt Brailsford
    0

    Ok, so it looks like it needs to be the ; character to separate email addresses, and it looks like we do validate email addresses during email sending, filtering out emails that don't match a regex:

    ^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,9}$
    

    This does however match [email protected] so it should be able to send to this email, but I have noticed that there is another regex validator in the UI files when entering an email that is a bit stricter https://github.com/TeaCommerce/Tea-Commerce-for-Umbraco/blob/master/Source/TeaCommerce.Umbraco.Application/Views/EmailTemplates/EditEmailTemplate.aspx.cs#L271

    As far as I can tell though, this should only stop you from entering the email in the UI, so you entering it in the DB should work. Did you clear your cache when you did this (touch your web.config)?

  • Rasmus Fjord 675 posts 1566 karma points c-trib
    Apr 20, 2021 @ 06:16
    Rasmus Fjord
    0

    I just tried adding it back to the database and touching the web.config, forgot about that part and it works! :D

    Thx for the detective job

Please Sign in or register to post replies

Write your reply to:

Draft