how to create a subscribe form in OpenEMM
Posted: Wed Apr 30, 2008 7:27 pm
OpenEMM does not have the forms you require to have users subscribe to your list automatically. You will have to create one.
Start by going to the forms section.
Click on new form
Enter a name for the form. I used "Subscribe". do not use spaces as they will cause problems when calling the form at the address bar in your web browser
Enter a description. optional
Leave action on No action
Enter code into success-form.code follows
Enter error message into error-form.something nice like "oops!"
Leave action on No action
Click on Save
You've created a form
To access this form enter http://xxxxxxxxx:8080/form.do?agnCI=1&agnFN=FormName into your web browser where xxxxxxxxx is the domain name or ip address of the server hosting OpenEMM and FormName is the name you called your form.
You can see how the form name you chose is used directly in the URL which makes using space a problem. Also remember that in OpenEMM agnCI=1 is always used because the open source version doesn't support multiple companies but the tag is still required.
In this example, I have asked for 3 things from people signing up. First name, Last name, and email. I have also given 2 choices for mailing lists. because OpenEMM requires all data fields to be filled, I have included the additional data as "hidden" with the data values set to a default value.
So in order:
<input type="hidden" name="agnCI" value="1">
type="hidden" means it won't be shown on screen, but can be seen by end user if they choose view source.
name=agnCI is the db variable that you are trying to modify or update.
value="1" is the information you will put into the variable.
agnCI is the company code that is required on all transactions in OpenEMM
agnFN is the form that is called when the submit button is pressed. info in following post
MAILTYPE is the selection text, html or offlineHTML. everyone gets html o=text, 1=HTML, 2=offlineHTML
LASTNAME is the last name.
FIRSTNAME is the first name.
EMAIL is the email address. these should be self explanatory
The next section is more complicated as we are putting check boxes for the mailing lists that people will subscribe to.
name=agnMAILINGLIST is the variable for the mailing list that you've created, value="1" sets the value of the variable to that of the mailing list. you can see what this value should be by clicking on mailing lists in the program and it will be listed on the left side under the heading ID.
note that this is hidden, but is triggered by the checkbox with the name agnSUBSCRIBE. These variables are somehow tied together. No real explanation for this, but they are.
This is important, agnMAILINGLIST, and agnSUBSCRIBE must have a number after them that correspondes to the ID and the value. What this means is when you create another form for a separate mailing list, you have to label the variables and value to match. When we created a third mailing list with its own sign up form, we had to label the variables agnMAILINGLIST3 and agnSUBSCRIBE3 and set value="3" in the form.
At the end of the form is the submit button. the value="xxxxxxx" is where you change the label listed on the button. I have left it the same as the "example" code in the manual.
<next is the forms that this one calls>
Start by going to the forms section.
Click on new form
Enter a name for the form. I used "Subscribe". do not use spaces as they will cause problems when calling the form at the address bar in your web browser
Enter a description. optional
Leave action on No action
Enter code into success-form.code follows
Enter error message into error-form.something nice like "oops!"
Leave action on No action
Click on Save
You've created a form
To access this form enter http://xxxxxxxxx:8080/form.do?agnCI=1&agnFN=FormName into your web browser where xxxxxxxxx is the domain name or ip address of the server hosting OpenEMM and FormName is the name you called your form.
You can see how the form name you chose is used directly in the URL which makes using space a problem. Also remember that in OpenEMM agnCI=1 is always used because the open source version doesn't support multiple companies but the tag is still required.
Code: Select all
<form action="form.do" method=post>
<!-- static inputs required, but not used -->
<input type="hidden" name="agnCI" value="1">
<input type="hidden" name="agnFN" value="SaveProfile">
<input type="hidden" name="MAILTYPE" value="1">
<input type="hidden" name="GENDER" value="2">
<input type="hidden" name="agnFN" value="SaveProfile">
<!-- user inputs -->
<br>
Firstname: <input type="text" name="FIRSTNAME" value=""><br>
Lastname: <input type="text" name="LASTNAME" value=""><br>
E-mail: <input type="text" name="EMAIL" value=""><br>
<!-- list of mailings -->
<br>
Check this box to subscribe to our course mailings <input type="checkbox" name="agnSUBSCRIBE"
value="1"><br>
<input type="hidden" name="agnMAILINGLIST" value="1">
Check this box to subscribe to our Newsletter <input type="checkbox" name="agnSUBSCRIBE2"
value="1"><br>
<input type="hidden" name="agnMAILINGLIST2" value="2">
<input type="submit" value="Submit">
</form>
So in order:
<input type="hidden" name="agnCI" value="1">
type="hidden" means it won't be shown on screen, but can be seen by end user if they choose view source.
name=agnCI is the db variable that you are trying to modify or update.
value="1" is the information you will put into the variable.
agnCI is the company code that is required on all transactions in OpenEMM
agnFN is the form that is called when the submit button is pressed. info in following post
MAILTYPE is the selection text, html or offlineHTML. everyone gets html o=text, 1=HTML, 2=offlineHTML
LASTNAME is the last name.
FIRSTNAME is the first name.
EMAIL is the email address. these should be self explanatory
The next section is more complicated as we are putting check boxes for the mailing lists that people will subscribe to.
name=agnMAILINGLIST is the variable for the mailing list that you've created, value="1" sets the value of the variable to that of the mailing list. you can see what this value should be by clicking on mailing lists in the program and it will be listed on the left side under the heading ID.
note that this is hidden, but is triggered by the checkbox with the name agnSUBSCRIBE. These variables are somehow tied together. No real explanation for this, but they are.
This is important, agnMAILINGLIST, and agnSUBSCRIBE must have a number after them that correspondes to the ID and the value. What this means is when you create another form for a separate mailing list, you have to label the variables and value to match. When we created a third mailing list with its own sign up form, we had to label the variables agnMAILINGLIST3 and agnSUBSCRIBE3 and set value="3" in the form.
At the end of the form is the submit button. the value="xxxxxxx" is where you change the label listed on the button. I have left it the same as the "example" code in the manual.
<next is the forms that this one calls>