Auto populate attribute

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
km67
Posts: 2
Joined: Sun Apr 14, 2013 7:34 pm

Auto populate attribute

Post by km67 »

Hi everyone,

My first post here. I hope someone will be able to help me with this.

I have a simple events registration form with an attribute CampaignCode.

There will be multiple email campaigns going out, each with a different campaign code for new people that are not on the system already.

Within the emails the URL to register their interest will be something like:-
https://www.example.com/?CampaignCode=June22
https://www.example.com/?CampaignCode=July22

How can I automatically populate attribute CampaignCode depending on the email campaign code?

Any pointers or examples will be much appreciated.
joben
Posts: 221
Joined: Wed Nov 06, 2019 9:49 pm
Location: Sweden
Contact:

Re: Auto populate attribute

Post by joben »

Welcome!

Look up StartProcessWithInit in the User guide.
Regards, Joakim

Image
Jaymer
Posts: 2430
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Auto populate attribute

Post by Jaymer »

There’s a lot of stuff going on here.
I would think you’re gonna want to use an encrypted URL, because if I saw a URL like the one you showed in your example, I would change it from June 22 to June 23 to June 24 just to play with it and see what else happened, if I was some techie type on the other end.
So by using an encrypted URL, which is the e= option, then someone cannot tinker around with where you’re sending them.

And of course a clickable link in an email is just an anchor tag with an href. Ex. <a href=theURL>Click here</a>
So all you have to do is build a string which contains the campaign code, and that string will get replaced in the HTML (theURL above)

So, the first step is making the URL that gets them where you want to go.
Once that works, translate that to working code to build that string.
Then you can mess with physically emailing it.

Step 1
Myurl.com/AwareIM/logonOp.aw?app=xx&user=xx&password=xx&firstcommand=xxx etc

As Was suggested, which exact function you use really depends on what you’re going to do.
Firstcommand, startprocess, startprocesswithinit, etc.
There’s a table of those towards the bottom of the user guide in the docs folder in your install directory.
Open the user guide and just search for this. “startprocesswith”

As long as it’s just you testing URLs, you can have the user ID and password visible. It’s just a test user ID you create. So you’ll need to look up on the documentation about doing a logonOp from the command line, and also search for firstcommand in the docs. Or search the forum. If using “guest” mode you’ll go a diff route slightly. Note: guest mode url logins do not work in test mode, only on a published BSV. That makes it harder because every time you make one change you have to publish.
Just gonna take a lot longer to test. But if you’re not gonna use guest mode, and you have to have a valid user ID and password for everyone u send an email to.
Which might be OK if they’ve already registered and you know they’re gonna come to the system, then they’re gonna be a user at some point anyway. But if it’s traditional 7% response on mass mailings, then I don’t think you’re gonna create a user ID for everyone you’re sending an email to, because most of them will never come. That’s up to you and your app. Obviously

So this is still step 1 where I said try and get logged in from the URL. Make it so that you got a working URL that takes you to the program that you would want to show them when they have clicked on your link in the email.
Once you do that then in real life, you will want that to be encrypted because you don’t want them to see and tinker with the parameters that are coming in. So you’ll need to use the encrypt function and then the e= variation As shown in the next example.

Here’s an encrypted login example
Myurl:8080/AwareIM/logonOp.aw?e=AB1eSQsVARAFFgYFHBM6URklSQQRFBYDFwo8GJEkEERRvFhgNEw0WACUHBx0YVz4ZHQRJVhUsBxZSEFkBBQ0iG10ZIRoXSQVEEgQNMQZfFyUHAEZafBwREA83WBEjHywjRY2GgJCClpIU00CR3NYHhUfXg%3D%3D

This encrypted login has a user ID and password and a instruction on which program to run.
They click on an email and it logs them in and shows them a form. That’s where you would have them enter some more information and save etc.

Once you have that string that you can paste in a browser window and up comes the correct form
Now you know what needs to be in the href in the email.
So you’re gonna make the email, which is a whole Other topic, but now you know what was originally the answer to your question, how do I refer to a specific campaign code. and how you do that is by the parameters that are coming in encrypted in that URL. So you test and get all this working before you ever need to mess with an email.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
km67
Posts: 2
Joined: Sun Apr 14, 2013 7:34 pm

Re: Auto populate attribute

Post by km67 »

Thank you both and sorry for the late reply. Busy with life stuff etc.

I will take a look at the documentation. I just need to present a blank registration form for a new person (Not already on database so no ID & Password) but pre-populate the CampaignCode attribute with a predetermined code in the URL.
Post Reply