Developer forum

Forum » Development » Email sent notifier

Email sent notifier

Anders Ebdrup
Reply

Hello!

 

I am using the EmailRecipientProvider, but how do I mark that an email has been successfully sent to an user, so I am not sending the same email twice?

Do we have a notifier or something like that?

 

Best regards, Anders


Replies

 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply
This post has been marked as an answer

Hi Anders,

 

I assume, you don't want to send to the same email to the same recipient again, but if the RecipientProvider were to be used in a different email, the recipient would be relevant again? If so, this is handled by Email Marketing. As long as the RecipientKey is the same, that recipient will not receive that email again.

 

- Jeppe

Votes for this answer: 1
 
Anders Ebdrup
Reply

Hi Jeppe,

 

Thanks for a very quick respons! Then I should just make sure that the recipient key is unique :-)

 

Thanks again and best regards, Anders

 
Anders Ebdrup
Reply

Hi Jeppe,

 

One thing that bothers me with that solution is that the collection of recipients to be collected from the database and iterated will increase over time because you do not have a notifier that makes is possible to flag a recipient for not having to receive mail.
To make the selection on the basis of the time I do not think is optimal for example, if the scheduled tasks do not run for a period, then there will be users who do not receive an e-mail it they falls out of the time frame.

 

Best regards, Anders

 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply

You are correct and it was also one of my concerns. We went with this solution though, for a couple reasons:

  • Removing recipients is ultimately handled by Dynamicweb, which means we have built-in mechanisms to prevent spamming.
  • We don't prevent a custom RecipientProvider from handling this by maintaining its own list (or do a look-up in the EmailRecipient table).
  • It was fairly simple to implement and can always be changed later.

It should also be noted that recipient descrimination is done in the background as this is only something you'll experience for recurring emails. For one-time emails, this check is skipped as no previous recipients for that email exist.

I hope this helps to allay some of your concerns :)

- Jeppe

 
Anders Ebdrup
Reply

Hi Jeppe,

 

Some of it :-) My next question is how to send multiple mails to the same email address?? Isn't possible to override this behaviour?

 

Best regards, Anders

 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply

As long as the RecipientKey is different, we will still send the email to the Recipient. The email address is not checked.

Take, for example, the AbandonedCartProvider. We use the OrderID of the cart as the RecipientKey. Let's say a customer with email "cust@mydomain.com" abandons a cart with ID "CART12" and a cart "CART41". We will send him one email per abandoned cart as the OrderID acts as the discriminator, not the email address. Basically, we see him as two different recipients with two different entries in the EmailRecipient table. One has a RecipientKey = "CART12" and the other has a RecipientKey = "CART41" but they both have the same email address.

 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply

Note though, it's not possible to send the same email to the same email address at the same time. The RecipientCollection will not allow a new Recipient object with the same email address as another Recipient object already in the collection. But for recurring emails, it's entirely possible to send to the same email address again.

 
Anders Ebdrup
Reply

Exactly, but when using unique content for each mail it should be possible to implement this instead for the system blocking for an intended behaviour

 

That's my two cents :-)

 

Best regards, Anders

 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply

Duly noted.

I will keep this in mind next time we're talking about improvements internally.

 

You must be logged in to post in the forum