Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Using Axon in your own DotNetNuke modulesUsing Axon in your own DotNetNuke modules
Previous
 
Next
New Post
1/14/2009 4:38 PM
 

There have been a lot of requests on how to use Axon with custom modules so I wanted to post some information here on how to do that.   If there are any questions on this information or if you need to know how to use Axon in another way, post it here and I'll explain in detail how it can be done.

Additional information about this is on the http://dotnetnukeemail.com/GettingStartedwithAxon/AddOnModules/ExtendAxon/tabid/387/Default.aspx

Axon is designed to be used by external applications or other modules, allowing you to use the robust email processing engine in Axon for all of your email needs in your own modules and applications. To control Axon from your own module, add a reference to the core OnyakTech.Axon.dll assembly. Once you do this, you will have access to all of the core functionality in Axon. Most of what you will need is in the OnyakTech.Axon.CampaignEngine class. This class contains methods specifically created for use by external modules.

To work with a Campaign, create an instance of the CampaignEngine class and pass the ID of the Campaign you want to work with as a parameter to the constructor of this class. Once the class is initialized, you can easily run batches, execute a new run, get a list of current runs, etc. You can even use Axon for rendering the content and have it returned to you for display in your modules or email it through your application.

Send Axon Emails based on the Email Address
The following sample code will open campaign, process the content based on the email address you provide (this will render any dynamic content into the email body you have setup in the Campaign for the email address.  For example, if you have added dynamic content in your campaign that displays a users current orders, subscription levels or attached a PDF report with information specific to a user, Axon will match the email address you provided with a user registered in your DotNetNuke web site and then fill in all of the dynamic content that relates to that user.)

Obtain Processed Email Body HTML
Another approach is to call the PreviewRun function passing the email address as a parameter.  This will return the email body contents as HTML that you can then display in your module or send it.  Using this method you won't need to set the FixedList since Axon ignores the campaign recipients and processes the email content based on the email address you pass in the parameter. 

Dim strEmailBodyHTML As String
Dim
AxonEngine As New OnyakTech.Axon.CampaignEngine(objCampaign.CampaignSystemID, False)
strEmailBodyHTML = AxonEngine.PreviewRun(
"somebody@domain.com")
' Returns the HTML for the email

Multithreaded Execution
If you would like to execute a campaign that may contain over 100,000 recipients, you will want to submit the campaign for execution in it's own thread and then check it's progress.

Dim NukeRun As CampaignEngine
NukeRun =
New CampaignEngine(CampaignSystemID, True)
thr =
New System.Threading.Thread(AddressOf
NukeRun.Execute)
thr.Start()

The code above will process the campaign in a new thread.  At set intervals, you can then check it's progress by looking at the StopExecution property as shown below.

If CampaignEngine.workerStatus= True Then
'Campaign has completed it's run.
Else
'Campaign is still running.
lblStatus.Text = "Progress: (" & CampaignEngine.EmailSentCount & " out of " & CampaignEngine.EmailToSendCount & " emails sent)"
End
If

Cancel Execution
If you need to stop a run, set the Stop Execution property to True.  Example: CampaignEngine.StopExecution = True

Summary
Axon provides everything you will need to create and send emails with dynamic content.  For a complete list of all available methods, take a look at the Axon namespace in the Object Browser in Visual Studio. Additional methods are listed below that you can call from your own module.

ExecuteInboxMessageProcessor() : Runs all POP3 Related functions of Axon.   Executes the Auto Response Campaigns, List Server Campaigns, Unsubscribers and Non-Delivery Reports.

ExecuteThreads() : Runs all campaigns of type Threaded.

WorkerStatusInfo : Property that contains detailed information about the current execution.

EmailSentCount : Property that contains the total number of emails sent during the current execution.

EmailToSendCount : Property that contains the total number of recipients.

StartTime : Property that contains the date and time the execution started.

 



Professional DNN Extensions, custom solutions and mobile apps since 2003.
www.OnyakTech.com
 
New Post
6/9/2009 3:44 AM
 

Hey how you can use Axon to run compain not on schedule but manully . For example there is an option to execute specific compain by clicking "Run Now" option in the compaign menu. But how to execute this compaign from another module?? through javascript and server side scripting???

the scenerio is...

I created a campaign to run at 17:00 every day to send a fblog post to all the employees in a specific department. I want to give forum author rights to run that campain manually by just clicking a button in blog when ever they feel its an important blog , withough accessing the axon admin pane where you play around with compains.

 

 
New Post
6/9/2009 5:30 PM
 

Click the link below for information on how to run a campaign from another module.  It contains some sample code that will give you an idea of how to do it.  Let me know if you need more information or have any other questions on this.

http://dotnetnukeemail.com/GettingStartedwithAxon/AddOnModules/ExtendAxon/tabid/387/Default.aspx



Professional DNN Extensions, custom solutions and mobile apps since 2003.
www.OnyakTech.com
 
New Post
6/29/2009 1:35 PM
 

Hey thanx for you reply. I am having a trouble hope u will help me out. Is possible to change email body of the campaign through code? I have 2 templates and i want to chage the campign email body dynamically on the basis of some condition. e.g if A=B then campign template 1 else Template 2

 
New Post
8/17/2009 6:33 PM
 

Yes you can change the email body content in your code.  I tried to post an example here but these forums are not allowing the code.  Please contact me directly (support @ onyaktech.com) and I will send you some sample code that you can use.  Also let me know if you want the sample code in VB.Net or C#.Net.



Professional DNN Extensions, custom solutions and mobile apps since 2003.
www.OnyakTech.com
 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Using Axon in your own DotNetNuke modulesUsing Axon in your own DotNetNuke modules


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out