Getting sent emails

Compassion Australia asked on July 8, 2014 18:51

I would like to access emails send via kentico so that I can integrate them with our CRM so we can view that the email was sent when people call in to the call centre.

Is there an API available to get access to sent emails.

Recent Answers


Brenden Kehren answered on July 8, 2014 20:07

Look into the EmailInfo and EmailInfoProvider classes. You should be able to check the EmailStatus, EmailLastSendAttempt and EmailLastSendResult properties to get what you need.

0 votesVote for this answer Mark as a Correct answer

Compassion Australia answered on July 9, 2014 00:23

I might need a little more help They seem to be the correct classes but I have not been able to find much documentation on them.

http://devnet.kentico.com/docs/8_0/api/html/T_CMS_EmailEngine_EmailInfoProvider.htm

Would you be able to show me how I might get the last sent email by email address?

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on July 10, 2014 08:30

Here's what the SQL statement would look like:

select top 1 *
from CMS_Email 
where emailto = 'your@email.com'
    and EmailStatus = 3
order by EmailLastSendAttempt desc

So essentially you need to do something like this in code:

var email = CMS.EmailEngine.EmailInfoProvider.GetEmailInfos("EmailTo = 'your@email.com' AND EmailStatus = 3", "EmailLastSendAttempt DESC", 1, "");

This should get you an InfoDataSet<EmailInfo> you can iterate through.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.