Campaign name in Email

vendim Birbili asked on July 15, 2019 15:48

I am tracking the SQL that get executed when an email campaign is scheduled to send emails out. I am looking to retrieve @IssueID which is a field on Newsletter_NewsletterIssue. is there a way to capture that via KEntico API or other way in the code? below is the query that gets executed when email is getting created and also it get executed when it scheduled or send. I want to get the IssueDisplayName from that PArameter to pass it to an external email Provider via API.

DECLARE @IssueID int = 9;

SELECT TOP 1 * FROM Newsletter_NewsletterIssue WHERE [IssueID] = @IssueID

Recent Answers


Brenden Kehren answered on July 15, 2019 19:05

Where are you doing this work? In the email template/issue? OR in some custom C# handler in Kentico?

0 votesVote for this answer Mark as a Correct answer

vendim Birbili answered on July 15, 2019 19:36

we are doing this via custome C# handler to call third party email Provider via their API. along with email information ( information that get stored on CMS_Email) we want to send the email Display name ( or we called as Campaign Name). and that information is only on the Newsletter_NewsletterIssue. thanks

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on July 16, 2019 18:30

What is the global event you're working with?

0 votesVote for this answer Mark as a Correct answer

vendim Birbili answered on July 16, 2019 20:25

we are calling on sendcomplete

CustomCompletedEventArgs args = new CustomCompletedEventArgs(null, false, emailToken); OnSendCompleted(args);

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on July 17, 2019 15:02

What version are you working in?

Looking at the documentation for a custom email provider, it doesn't look like that information is available there. The macros are resolved prior to being processed by the email queue. So your event needs to happen sometime when the actual email newsletter is processed.

Better yet, if you can, create a custom macro to get the info based on a value available in the Email Marketing Email Builder.

0 votesVote for this answer Mark as a Correct answer

vendim Birbili answered on July 19, 2019 06:10

Thanks Brandon, for this line ""Better yet, if you can, create a custom macro to get the info based on a value available in the Email Marketing Email Builder." we are creating Macro to have a custom Widget on the email body. are you saying that we can create a MAcro to retrieve the IssueID when the email get saved? is there anywhere documented on what event is available to get that? I am surprise though that Kentico doesnt maintain the relationship after emails is send..

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on July 19, 2019 15:25

The relationship between emails which are sent and the application which sent them is not needed from an email queue perspective. All of the processing of the context of that email is done within the application sending it and then sent to a "generic" email processing provider. This provider could be one within Kentico or another provider outside of Kentico which is why it's generic in nature.

What I'm saying regarding the macro is you'd create this macro and use/place it in the context of your email body. It would take 1 or many property values from the the email body and process them when it is sent to output the value you're looking for.

0 votesVote for this answer Mark as a Correct answer

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