Closed almothafar closed 3 years ago
@almothafar there haven't been any changes to the Postmark's API and it should l be working as expected - Postmark allows up to 50 recipients as comma separated list in a string: https://postmarkapp.com/developer/api/templates-api#email-with-template
It seems to me that there is something wrong with the string you're passing as the "To" field. It is not email1@company.com,email2@company.com
but "email1@company.com,email2@company.com"
(note the surrounding quotes) instead - could you check that?
You can also show us how you're constructing that message with multiple recipients.
@tomazy I don't have any quotes around emails, also, I checked logs everything was working fine from 28th of Oct to 7th of Nov, we did 0 changes to the code, and we didn't do any deployment on the 7th of 8th of Nov. where the issue starts to happen, I did another deployment in 14th of Nov. but still having the same issue.
I have something like this:
String from = "noreply@mycompany.com";
String to = "email1@company.com,email2@company.com";
Integer templateId = 123;
String subject = "Test subject";
final TemplatedMessage templatedMessage = new TemplatedMessage(from, to, templateId);
templatedMessage.setReplyTo(from);
templatedMessage.setTemplateModel(Json.toJson(templateData));
client.deliverMessageWithTemplate(templatedMessage);
OK, finally I saw the issue, To was "Name" <email1@company.com,email2@company.com>
when I debugged it inside the postmark code itself, I found the reason for this, but I'm still confused, it was working like that before and now not working, or the change that deployed in 14th Nov. that written in 11th of Nov. somehow deployed to production in 7th to 8th of Nov., is that myself traveled in the time? or again that "Name" <email1@company.com,email2@company.com>
was working and now not.
I'm totally confused...
Anyway, I fixed this from my side.
And still, if you can see my other notes in bullets will be nice, I can open another issue of these bullets if you want.
@almothafar glad you were able to locate and fix the problem. I'm going to close this ticket and please open separate ticket for other issues you have with the library.
It seems this issue started to happen recently since the 8th of November, it seems that contains breaking changes for some reason, I was using Message and TemplateMessage and sending emails to multiple addresses with a comma-separated form like
email1@company.com,email2@company.com
.Currently, it starts to fire exceptions in the log:
so, I wanted to fix that and I see there is a function called
.setTo()
that accepts an array or a map inMessage
and accepts Map only inTemplatedMessage
which I don't understand and is confusing:.setTo
?.setTo
accept only a map inTemplatedMessage
, why I don't have a function that accepts a list inTemplatedMessage
likeMessage
, as I have addresses and without names in my current situation.Al-Mothafar Al-Hasan<almothafar@company.com>
andAl-Mothafar Al-Hasan<almothafar@another-company.com>
.