put the unsubscribe link in the CS notification template

This commit is contained in:
James Tolley 2007-07-10 21:39:11 +00:00
parent eabffb0342
commit de4da68884
5 changed files with 117 additions and 64 deletions

View file

@ -0,0 +1,47 @@
#PBtmpl0000000000000027
<table border="0" cellpadding="3" cellspacing="2">
<tbody>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td bgcolor="black" style="background-color:black;"><font color="white"><b style="color:white;"><tmpl_var username> has posted to one of your subscriptions</b></font></td>
</tr>
<tr>
<td bgcolor="#DFDFDF" style="background-color:#DFDFDF;"><a href="<tmpl_var url>"><font color="black"><tmpl_var url></a></td>
</tr>
<tr>
<td bgcolor="#F0F0F0" style="background-color:#F0F0F0;"><tmpl_var content></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tmpl_if userDefined1>
<tr>
<td bgcolor="#F0F0F0" style="background-color:#F0F0F0;"><tmpl_var userDefined1></td>
</tr>
</tmpl_if>
<tmpl_if userDefined2>
<tr>
<td bgcolor="#F0F0F0" style="background-color:#F0F0F0;"><tmpl_var userDefined2></td>
</tr>
</tmpl_if>
<tmpl_if userDefined3>
<tr>
<td bgcolor="#F0F0F0" style="background-color:#F0F0F0;"><tmpl_var userDefined3></td>
</tr>
</tmpl_if>
<tmpl_if userDefined4>
<tr>
<td bgcolor="#F0F0F0" style="background-color:#F0F0F0;"><tmpl_var userDefined4></td>
</tr>
</tmpl_if>
<tmpl_if userDefined5>
<tr>
<td bgcolor="#F0F0F0" style="background-color:#F0F0F0;"><tmpl_var userDefined5></td>
</tr>
</tmpl_if>
</tbody>
</table>
<p><a href="<tmpl_var unsubscribeUrl>"><tmpl_var unsubscribeLinkText></a></p>

View file

@ -40,6 +40,8 @@ finish($session); # this line required
sub addCanStartThreadToCS {
my $session = shift;
print "\tAdding canStartThreadGroupId setting to Collaboration Systems.\n" unless ($quiet);
# add the columns required
$session->db->write("ALTER TABLE Collaboration add column canStartThreadGroupId varchar(22) NOT NULL default 2 AFTER postGroupId");
$session->db->write("ALTER TABLE Collaboration add column threadApprovalWorkflow varchar(22) NOT NULL default 'pbworkflow000000000003' AFTER approvalWorkflow");
@ -58,8 +60,8 @@ sub addCanStartThreadToCS {
#-------------------------------------------------
sub addKeywordTagging {
my $session = shift;
print "\tAdding a keyword tagging system.\n" unless ($quiet);
my $session = shift;
print "\tAdding a keyword tagging system.\n" unless ($quiet);
$session->db->write("create table assetKeyword (
keyword varchar(64) not null,
assetId varchar(22) binary not null,

View file

@ -1839,7 +1839,7 @@ sub processTemplate {
$var->{$meta->{$field}{fieldName}} = $meta->{$field}{value};
}
$var->{'controls'} = $self->getToolbar;
my %vars = (
my %vars = (
%{$self->{_properties}},
%{$var}
);

View file

@ -726,42 +726,43 @@ Send notifications to the thread and forum subscribers that a new post has been
=cut
sub notifySubscribers {
my $self = shift;
my $i18n = WebGUI::International->new($self->session);
my $var = $self->getTemplateVars();
my $thread = $self->getThread;
my $cs = $thread->getParent;
$cs->appendTemplateLabels($var);
$var->{relativeUrl} = $var->{url};
my $siteurl = $self->session->url->getSiteURL();
$var->{url} = $siteurl.$self->getUrl;
$var->{'notify.subscription.message'} = $i18n->get(875,"Asset_Post");
my $message = $self->processTemplate($var, $cs->get("notificationTemplateId"));
my $user = WebGUI::User->new($self->session, $self->get("ownerUserId"));
my $setting = $self->session->setting;
my $returnAddress = $setting->get("mailReturnPath");
my $companyAddress = $setting->get("companyEmail");
my $listAddress = $cs->get("mailAddress");
my $posterAddress = $user->profileField("email");
my $from = $posterAddress || $listAddress || $companyAddress;
my $replyTo = $listAddress || $returnAddress || $companyAddress;
my $sender = $listAddress || $companyAddress || $posterAddress;
my $returnPath = $returnAddress || $sender;
my $listId = $sender;
$listId =~ s/\@/\./;
my $domain = $cs->get("mailAddress");
$domain =~ s/.*\@(.*)/$1/;
my $messageId = "cs-".$self->getId.'@'.$domain;
my $replyId = "";
if ($self->isReply) {
$replyId = "cs-".$self->getParent->getId.'@'.$domain;
}
my $subject = $cs->get("mailPrefix").$self->get("title");
foreach my $subscriptionAsset ($cs, $thread) {
my $groupId = $subscriptionAsset->get('subscriptionGroupId');
my $unsubscribe = '<p><a href="'.$siteurl.$subscriptionAsset->getUnsubscribeUrl.'">'.$i18n->get("unsubscribe","Asset_Collaboration").'</a></p>';
my $mail = WebGUI::Mail::Send->create($self->session, {
my $self = shift;
my $i18n = WebGUI::International->new($self->session);
my $var = $self->getTemplateVars();
my $thread = $self->getThread;
my $cs = $thread->getParent;
$cs->appendTemplateLabels($var);
$var->{relativeUrl} = $var->{url};
my $siteurl = $self->session->url->getSiteURL();
$var->{url} = $siteurl.$self->getUrl;
$var->{'notify.subscription.message'} = $i18n->get(875,"Asset_Post");
my $user = WebGUI::User->new($self->session, $self->get("ownerUserId"));
my $setting = $self->session->setting;
my $returnAddress = $setting->get("mailReturnPath");
my $companyAddress = $setting->get("companyEmail");
my $listAddress = $cs->get("mailAddress");
my $posterAddress = $user->profileField("email");
my $from = $posterAddress || $listAddress || $companyAddress;
my $replyTo = $listAddress || $returnAddress || $companyAddress;
my $sender = $listAddress || $companyAddress || $posterAddress;
my $returnPath = $returnAddress || $sender;
my $listId = $sender;
$listId =~ s/\@/\./;
my $domain = $cs->get("mailAddress");
$domain =~ s/.*\@(.*)/$1/;
my $messageId = "cs-".$self->getId.'@'.$domain;
my $replyId = "";
if ($self->isReply) {
$replyId = "cs-".$self->getParent->getId.'@'.$domain;
}
my $subject = $cs->get("mailPrefix").$self->get("title");
foreach my $subscriptionAsset ($cs, $thread) {
$var->{unsubscribeUrl} = $siteurl.$subscriptionAsset->getUnsubscribeUrl;
$var->{unsubscribeLinkText} = $i18n->get("unsubscribe","Asset_Collaboration");
my $message = $self->processTemplate($var, $cs->get("notificationTemplateId"));
my $groupId = $subscriptionAsset->get('subscriptionGroupId');
my $mail = WebGUI::Mail::Send->create($self->session, {
from=>"<".$from.">",
returnPath => "<".$returnPath.">",
replyTo=>"<".$replyTo.">",
@ -769,29 +770,29 @@ sub notifySubscribers {
subject=>$subject,
messageId=>'<'.$messageId.'>'
});
if ($self->isReply) {
$mail->addHeaderField("In-Reply-To", "<".$replyId.">");
$mail->addHeaderField("References", "<".$replyId.">");
}
$mail->addHeaderField("List-ID", $cs->getTitle." <".$listId.">");
$mail->addHeaderField("List-Help", "<mailto:".$companyAddress.">, <".$setting->get("companyURL").">");
$mail->addHeaderField("List-Unsubscribe", "<".$siteurl.$subscriptionAsset->getUnsubscribeUrl.">");
$mail->addHeaderField("List-Subscribe", "<".$siteurl.$subscriptionAsset->getSubscribeUrl.">");
$mail->addHeaderField("List-Owner", "<mailto:".$companyAddress.">, <".$setting->get("companyURL")."> (".$setting->get("companyName").")");
$mail->addHeaderField("Sender", "<".$sender.">");
if ($listAddress eq "") {
$mail->addHeaderField("List-Post", "No");
} else {
$mail->addHeaderField("List-Post", "<mailto:".$listAddress.">");
}
$mail->addHeaderField("List-Archive", "<".$siteurl.$cs->getUrl.">");
$mail->addHeaderField("X-Unsubscribe-Web", "<".$siteurl.$subscriptionAsset->getUnsubscribeUrl.">");
$mail->addHeaderField("X-Subscribe-Web", "<".$siteurl.$subscriptionAsset->getSubscribeUrl.">");
$mail->addHeaderField("X-Archives", "<".$siteurl.$cs->getUrl.">");
$mail->addHtml($message.$unsubscribe);
$mail->addFooter;
$mail->queue;
}
if ($self->isReply) {
$mail->addHeaderField("In-Reply-To", "<".$replyId.">");
$mail->addHeaderField("References", "<".$replyId.">");
}
$mail->addHeaderField("List-ID", $cs->getTitle." <".$listId.">");
$mail->addHeaderField("List-Help", "<mailto:".$companyAddress.">, <".$setting->get("companyURL").">");
$mail->addHeaderField("List-Unsubscribe", "<".$siteurl.$subscriptionAsset->getUnsubscribeUrl.">");
$mail->addHeaderField("List-Subscribe", "<".$siteurl.$subscriptionAsset->getSubscribeUrl.">");
$mail->addHeaderField("List-Owner", "<mailto:".$companyAddress.">, <".$setting->get("companyURL")."> (".$setting->get("companyName").")");
$mail->addHeaderField("Sender", "<".$sender.">");
if ($listAddress eq "") {
$mail->addHeaderField("List-Post", "No");
} else {
$mail->addHeaderField("List-Post", "<mailto:".$listAddress.">");
}
$mail->addHeaderField("List-Archive", "<".$siteurl.$cs->getUrl.">");
$mail->addHeaderField("X-Unsubscribe-Web", "<".$siteurl.$subscriptionAsset->getUnsubscribeUrl.">");
$mail->addHeaderField("X-Subscribe-Web", "<".$siteurl.$subscriptionAsset->getSubscribeUrl.">");
$mail->addHeaderField("X-Archives", "<".$siteurl.$cs->getUrl.">");
$mail->addHtml($message);
$mail->addFooter;
$mail->queue;
}
}

View file

@ -25,6 +25,7 @@ var pageHeight=0;
var pageWidth=0;
var scrollJump=50;
var blankCount=1;
var draggableListOrigClassNames = []; // make sure that we're preserving the locked-asset class, if present
//checks the key Events for copy and paste operations
//ctrlC ctrlV shiftP shiftY
@ -142,7 +143,8 @@ function dragable_init(url) {
for (i = 0; i< children.length;i++) {
draggableObjectList[draggableObjectList.length] = children[i];
dragableList[dragableList.length]=document.getElementById(children[i].id + "_div");
}
draggableListOrigClassNames[draggableListOrigClassNames.length] = dragableList[dragableList.length - 1].className;
}
}
obj = document.getElementById("position" + contentCount);
contentCount++;
@ -338,7 +340,8 @@ function dragable_dragStop(e) {
for(i=0;i<dragableList.length;i++) {
dragableList[i].style.top=0+"px";
dragableList[i].style.left=0+"px";
dragableList[i].className="dragable";
dragableList[i].className = draggableListOrigClassNames[i];
// dragableList[i].className="dragable";
}
//this is a ie hack for a render bug