Triggering send action based mailing

Use this forum for questions regarding adoption and functionality of OpenEMM

Moderator: moderator

Openemmer
Posts: 6
Joined: Tue Jan 27, 2015 10:45 am

Triggering send action based mailing

Post by Openemmer »

Hi,

I am trying to trigger a Send action based mailing ,to send my mailing when ever an event occurs in our system.

I have tried to call up a form to invoke the action but it was no use , I used:
http://{server}/form.do?agnCI=1&agnFN=ActionBasedForm&agnUID=##AGNUID##

Is there a way to invoke the action without a form?
or can someone just someone have any idea what could be the issue with the form?
maschoff
Site Admin
Posts: 2597
Joined: Thu Aug 03, 2006 10:20 am
Location: Munich, Germany
Contact:

Re: Triggering send action based mailing

Post by maschoff »

What is the content of your form ActionBasedForm?
OpenEMM Maintainer
Openemmer
Posts: 6
Joined: Tue Jan 27, 2015 10:45 am

Re: Triggering send action based mailing

Post by Openemmer »

It is supposed to trigger an action to send an action based mailing .

I have tried to call the form both with agnUID and without an agnUID.

The Form just contains the action of sending the mail and a simple success and error messages.
Is there any other content needed to make the form work properly?
maschoff
Site Admin
Posts: 2597
Joined: Thu Aug 03, 2006 10:20 am
Location: Munich, Germany
Contact:

Re: Triggering send action based mailing

Post by maschoff »

Where exactly did you place the link to trigger the form ActionBasedForm? On your website? In an EMM mailing? Anywhere else?
OpenEMM Maintainer
Openemmer
Posts: 6
Joined: Tue Jan 27, 2015 10:45 am

Re: Triggering send action based mailing

Post by Openemmer »

No where yet, to test it I am just inserting it in the browser to trigger the form.

I have also tried to use it in a mail but it also showed an error
maschoff
Site Admin
Posts: 2597
Joined: Thu Aug 03, 2006 10:20 am
Location: Munich, Germany
Contact:

Re: Triggering send action based mailing

Post by maschoff »

But how should the browser be able to replace ##AGNUID## with the correct ID string? This can not work.

You may call a website from an EMM form with "?agnUID=$!agnUID" attached to the URL to foward the AGNUID to the website or you can include the UID in an EMM form with "<input type="hidden" name="agnUID" value="$agnUID">". So, EMM somehow must be able to include the correct UID.
OpenEMM Maintainer
Openemmer
Posts: 6
Joined: Tue Jan 27, 2015 10:45 am

Re: Triggering send action based mailing

Post by Openemmer »

Is it possible to trigger the form using a URL somehow?
Maybe even generating UID you can supply it with to send the mailing to the right e-mail?

Basically I am trying to trigger a mail to be sent whenever an event on our website occurs,
if you have any other idea how to do this it would be helpful.
gtg472b
Posts: 7
Joined: Mon Apr 13, 2015 2:53 am

Re: Triggering send action based mailing

Post by gtg472b »

I just figured this out using PHP to create a UID (thanks to this thread, I stumbled upon what I needed to do to do the same thing: perform an action based on something happening on my website).


The link I used was:

http://[myopenemmserveraddress]/form.do?agnCI=$companyID&agnFN=$formname&agnUID=$UID

$companyID was 1 for me (what are the agnCI values you usually have in your links?)

$formname is "welcome" for me, which is the name of a form I created that has my action as the first action, and I'm having it redirect to my own URLs for success and error (though I haven't figured out how to pass any actual values from OpenEMM to these php files...any ideas?)

$UID I created based on the agn.py script that comes with OpenEMM (it converts the values to base 36 and formats it). My translated code is below. I think you could fake the URLID, as I'm using the wrong URLID and it still seems to work (I haven't checked whether the URLID has to exist yet, mine is an existing URL but it is to an unsubscribe, not a subscribe, which is what my action does).

the UID has the format:

[CompanyID].[MailingID].[CustomerID].[URLID].[signature]

where all of the values are in base 36 (rather than base 2, 8, 10, or 16).

signature I believe is acting like a check sum.


my password and prefix are both blank so I leave them as null, and it gives me the same UID as what OpenEMM would generate for a given customer, mailing, and URL.

Code: Select all

// PHP code for making a UID
function makeSignature( $str )
{
  $hashval = str_split( sha1( $str, true ) );
  $sig = "";
  for( $x = 0; $x < count( $hashval ); $x += 2 ){
    $sig .= base_convert( ( ord( $hashval[$x] ) >> 2 ) % 36, 10, 36 );
  }
  return $sig;
}


function createUID( $companyID, $mailingID, $customerID, $URLID, $password = null, $prefix = null )
{
  $baseUID = is_null( $prefix ) ? "" : $prefix . ".";

  $baseUID .=   base_convert( $companyID, 10, 36 ) . "." .
                base_convert( $mailingID, 10, 36 ) . "." .
                base_convert( $customerID, 10, 36 ) . "." .
                base_convert( $URLID, 10, 36 );

  return $baseUID . "." . makeSignature( $baseUID . "." . $password );
}
Post Reply