Mail Name in Unsub form
Moderator: moderator
-
- Posts: 10
- Joined: Fri Mar 18, 2011 5:31 pm
Mail Name in Unsub form
Hi, is this possible, displaying the Mail name in the unsubscribe step 1 form?
please point me to the correct direction.. can we use script action in the form itself?
please point me to the correct direction.. can we use script action in the form itself?
-
- Site Admin
- Posts: 2628
- Joined: Thu Aug 03, 2006 10:20 am
- Location: Munich, Germany
- Contact:
Re: Mail Name in Unsub form
Have you tried script command
in your unsubscribe form?
Code: Select all
$Mailing.getShortname
OpenEMM Maintainer
-
- Posts: 10
- Joined: Fri Mar 18, 2011 5:31 pm
Re: Mail Name in Unsub form
I have this unsub form and i included that script comment, its not working unless im doing it wrong:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<head>
<title>newsletter unsubscribe</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
<!--
body, table { font-family: Tahoma, Helvetica, sans-serif; font-size: 12px; }
h1 { font-family: Tahoma, Helvetica, sans-serif; font-size: 16px; }
select, input { font-family: Tahoma, Helvetica, sans-serif; font-size: 12px;}
select { width: 200px; }
-->
</style>
</head>
<body bgcolor="#C0C0C0" link="#bb2233" vlink="#bb2233" alink="#bb2233">
<table width="480" border="0" align="center" cellpadding="2" cellspacing="0">
<tr bgcolor="#808080">
<td bgcolor="#808080">
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td>
<form action="form.do">
<input type="hidden" name="agnCI" value="1">
<input type="hidden" name="agnFN" value="en_unsub_confirm">
<input type="hidden" name="agnUID" value="$!agnUID">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3"> </td>
</tr>
<tr>
<td width="10"> </td>
<td><h1><strong>$Mailing.getShortname</strong>UNSUBSCRIBE NEWSLETTER 1/2</h1>
<p>Do you really want to unsubscribe from our newsletter?</p>
<table border=0>
<tr><td width="120"><input type="submit" value=" Yes "></td>
<td><input type="reset" value=" No " onClick="javascript:history.back();"></td></tr>
</table>
</td>
<td width="10"> </td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<head>
<title>newsletter unsubscribe</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
<!--
body, table { font-family: Tahoma, Helvetica, sans-serif; font-size: 12px; }
h1 { font-family: Tahoma, Helvetica, sans-serif; font-size: 16px; }
select, input { font-family: Tahoma, Helvetica, sans-serif; font-size: 12px;}
select { width: 200px; }
-->
</style>
</head>
<body bgcolor="#C0C0C0" link="#bb2233" vlink="#bb2233" alink="#bb2233">
<table width="480" border="0" align="center" cellpadding="2" cellspacing="0">
<tr bgcolor="#808080">
<td bgcolor="#808080">
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td>
<form action="form.do">
<input type="hidden" name="agnCI" value="1">
<input type="hidden" name="agnFN" value="en_unsub_confirm">
<input type="hidden" name="agnUID" value="$!agnUID">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3"> </td>
</tr>
<tr>
<td width="10"> </td>
<td><h1><strong>$Mailing.getShortname</strong>UNSUBSCRIBE NEWSLETTER 1/2</h1>
<p>Do you really want to unsubscribe from our newsletter?</p>
<table border=0>
<tr><td width="120"><input type="submit" value=" Yes "></td>
<td><input type="reset" value=" No " onClick="javascript:history.back();"></td></tr>
</table>
</td>
<td width="10"> </td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
maschoff wrote:Have you tried script commandin your unsubscribe form?Code: Select all
$Mailing.getShortname
-
- Site Admin
- Posts: 2628
- Joined: Thu Aug 03, 2006 10:20 am
- Location: Munich, Germany
- Contact:
Re: Mail Name in Unsub form
You have to load the mailing object first with something like
But this would not help since you do not have the mailing ID (it is encoded in the UID, but there is no decode method available.
Code: Select all
#set($mail=$MailingDao.getMailing(ID, 1)
OpenEMM Maintainer
-
- Posts: 10
- Joined: Fri Mar 18, 2011 5:31 pm
Re: Mail Name in Unsub form
i managed to include the mailing id in the url, so i should be able to get the mailing already, but not working still: ($mail seems is not getting the value, because when i access th page, im getting the $mail.getId() being printed out in the page)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<head>
<title>newsletter unsubscribe</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
<!--
body, table { font-family: Tahoma, Helvetica, sans-serif; font-size: 12px; }
h1 { font-family: Tahoma, Helvetica, sans-serif; font-size: 16px; }
select, input { font-family: Tahoma, Helvetica, sans-serif; font-size: 12px;}
select { width: 200px; }
-->
</style>
</head>
<body bgcolor="#C0C0C0" link="#bb2233" vlink="#bb2233" alink="#bb2233">
<table width="480" border="0" align="center" cellpadding="2" cellspacing="0">
<tr bgcolor="#808080">
<td bgcolor="#808080">
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td>
<form action="form.do">
<input type="hidden" name="agnCI" value="1">
<input type="hidden" name="agnFN" value="en_unsub_confirm">
<input type="hidden" name="agnUID" value="$!agnUID">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3"> </td>
</tr>
<tr>
<td width="10"> </td>
#set ($mail=$MailingDao.getMailing(100, 1))
<td><h1><strong>$mail.getId()</strong>UNSUBSCRIBE NEWSLETTER 1/2</h1>
<p>Do you really want to unsubscribe from our newsletter?</p>
<table border=0>
<tr><td width="120"><input type="submit" value=" Yes "></td>
<td><input type="reset" value=" No " onClick="javascript:history.back();"></td></tr>
</table>
</td>
<td width="10"> </td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<head>
<title>newsletter unsubscribe</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
<!--
body, table { font-family: Tahoma, Helvetica, sans-serif; font-size: 12px; }
h1 { font-family: Tahoma, Helvetica, sans-serif; font-size: 16px; }
select, input { font-family: Tahoma, Helvetica, sans-serif; font-size: 12px;}
select { width: 200px; }
-->
</style>
</head>
<body bgcolor="#C0C0C0" link="#bb2233" vlink="#bb2233" alink="#bb2233">
<table width="480" border="0" align="center" cellpadding="2" cellspacing="0">
<tr bgcolor="#808080">
<td bgcolor="#808080">
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td>
<form action="form.do">
<input type="hidden" name="agnCI" value="1">
<input type="hidden" name="agnFN" value="en_unsub_confirm">
<input type="hidden" name="agnUID" value="$!agnUID">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3"> </td>
</tr>
<tr>
<td width="10"> </td>
#set ($mail=$MailingDao.getMailing(100, 1))
<td><h1><strong>$mail.getId()</strong>UNSUBSCRIBE NEWSLETTER 1/2</h1>
<p>Do you really want to unsubscribe from our newsletter?</p>
<table border=0>
<tr><td width="120"><input type="submit" value=" Yes "></td>
<td><input type="reset" value=" No " onClick="javascript:history.back();"></td></tr>
</table>
</td>
<td width="10"> </td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
maschoff wrote:You have to load the mailing object first with something likeBut this would not help since you do not have the mailing ID (it is encoded in the UID, but there is no decode method available.Code: Select all
#set($mail=$MailingDao.getMailing(ID, 1)
-
- Site Admin
- Posts: 2628
- Joined: Thu Aug 03, 2006 10:20 am
- Location: Munich, Germany
- Contact:
Re: Mail Name in Unsub form
There is no method getId(), but getMailingID(), getShortname(), etc.
OpenEMM Maintainer
-
- Posts: 10
- Joined: Fri Mar 18, 2011 5:31 pm
Re: Mail Name in Unsub form
ok.. i tried changing to this:
#set ($mail=$MailingDao.getMailing(100, 1))
<td><h1><strong>$mail.getShortname()</strong>UNSUBSCRIBE NEWSLETTER 1/2</h1>
and im just getting this printed out:
$mail.getShortname()UNSUBSCRIBE NEWSLETTER 1/2
Do you really want to unsubscribe from our newsletter?
it doesnt give me the shortname equivalent value. im sure that the mail id is 100 and is associated with company id 1. so what am i doing wrong?
#set ($mail=$MailingDao.getMailing(100, 1))
<td><h1><strong>$mail.getShortname()</strong>UNSUBSCRIBE NEWSLETTER 1/2</h1>
and im just getting this printed out:
$mail.getShortname()UNSUBSCRIBE NEWSLETTER 1/2
Do you really want to unsubscribe from our newsletter?
it doesnt give me the shortname equivalent value. im sure that the mail id is 100 and is associated with company id 1. so what am i doing wrong?
maschoff wrote:There is no method getId(), but getMailingID(), getShortname(), etc.
-
- Posts: 22
- Joined: Thu Aug 03, 2006 3:18 pm
- Location: Ruhpolding, BY, Germany
- Contact:
Re: Mail Name in Unsub form
Hello @ all,
i have tried it on my system and it works.
I have used zwo parts: 1x action, 1x form
Action: shortname
step 1: script-action
[Mailing_ID] = your mailing_id
Form:
aktion: shortname
Success-Form:
If i call now the url like http://yourdomain.com/form.do&agnCI=1&agnFN=[form-name]
i get the shortname of the mailing.
Greetings.
i have tried it on my system and it works.
I have used zwo parts: 1x action, 1x form
Action: shortname
step 1: script-action
Code: Select all
#set($mail=$MailingDao.getMailing([Mailing_ID], 1))
#set($scriptResult="1")
Form:
aktion: shortname
Success-Form:
Code: Select all
<h1><strong>$mail.getShortname()</strong>UNSUBSCRIBE NEWSLETTER 1/2</h1>
i get the shortname of the mailing.
Greetings.
-
- Posts: 10
- Joined: Fri Mar 18, 2011 5:31 pm
Re: Mail Name in Unsub form
finally i was able to make it work.. needed to convert the parameter to integer, thanks!
Hofmann M. wrote:Hello @ all,
i have tried it on my system and it works.
I have used zwo parts: 1x action, 1x form
Action: shortname
step 1: script-action[Mailing_ID] = your mailing_idCode: Select all
#set($mail=$MailingDao.getMailing([Mailing_ID], 1)) #set($scriptResult="1")
Form:
aktion: shortname
Success-Form:If i call now the url like http://yourdomain.com/form.do&agnCI=1&agnFN=[form-name]Code: Select all
<h1><strong>$mail.getShortname()</strong>UNSUBSCRIBE NEWSLETTER 1/2</h1>
i get the shortname of the mailing.
Greetings.
-
- Site Admin
- Posts: 2628
- Joined: Thu Aug 03, 2006 10:20 am
- Location: Munich, Germany
- Contact:
Re: Mail Name in Unsub form
We will update the script action examples in the doc to make it clearer how to implement stuff like this.
OpenEMM Maintainer
-
- Posts: 10
- Joined: Fri Mar 18, 2011 5:31 pm
Re: Mail Name in Unsub form
thanks!
maschoff wrote:We will update the script action examples in the doc to make it clearer how to implement stuff like this.