Posted on 07/06/2018 13:09:45
Hi Bjørn,
no that is not implemented. As a possible solution for now could be to use the Dynamicweb api and write your own method to return you all emails.
To get emails you can use:
Email.GetUpdatedEmailsFromLastExport().Where(e => e.IsEmailSent() && e.GetEmailSentStartTime() > emailsSentFromTime);
Or
emails = Email.GetEmails(true).Where(e => e.IsEmailSent() && e.GetEmailSentStartTime() > emailsSentFromTime);
Then you can get the EmailInfos and fix the sample code for your needs:
internal static List<EmailInfo> GetEmailsInfo(bool exportNotExportedEmails, DateTime emailsSentFromTime)
{
List<EmailInfo> ret = new List<EmailInfo>();
//todo: write your own GetEmails:
IEnumerable<Email> emails = GetEmails();
EmailStatistics stat = null;
foreach (Email e in emails)
{
if (e != null)
{
stat = new EmailStatistics(e);
foreach (ResponseItem ri in stat.GetResponses())
{
EmailInfo ei = new EmailInfo();
ei.ExternalUserID = ri.AccessUserExternalID;
ei.EmailID = e.ID;
ei.EmailSubject = ri.EmailSubject;
ei.EmailSendCompleteDate = e.GetEmailSentCompletedTime();
ei.ClickedLinks.Add(ri.Data);
ret.Add(ei);
}
}
}
//todo:
//merge your list with having EmailInfo for the same users "AccessUserExternalID":
//EmailInfo.ClickedLinks collection can be merged and duplicate EmailInfo's can be deleted
return ret;
}
Namespaces needed:
using Dynamicweb.EmailMarketing;
using Dynamicweb.EmailMarketing.Statistics;
using Dynamicweb.Mailing;
using Dynamicweb.Mailing.Links;
Regards, Dmitrij