Author Topic: Making !remove automatic on all emails  (Read 14229 times)

scottscomp

  • Posts: 18
    • View Profile
Making !remove automatic on all emails
« on: July 22, 2008, 07:06:55 am »
Is there an easy way to insert the !remove shortcode automatically into every single outgoing message?  I have a customer that will be using LMP and he tends to forget to add the !remove link..  I'd like to make it automatic for him.


-Scott

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
Making !remove automatic on all emails
« Reply #1 on: July 22, 2008, 11:08:45 am »
Hi Scott, Not an easy mod, this one, as there are so many different types of messages sent by LMP.

Search admin.php for
Code: [Select]
  if(!$nouser){

You will see numerous if() statements that set the message body.

If you want to mod sent messages, scheduled messages, followups and the welcome email, add custom code just before this line:
Code: [Select]
   if($mtype=='4' && (!$conf || $xid == 'resume')){

Something like this should do it
Code: [Select]
if($mtype<'4' && !strstr($msg,'!remove')) $msg=trim($msg)."\n\n!remove";
Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

Justin Thomas

  • Guest
Re: Making !remove automatic on all emails
« Reply #2 on: July 10, 2012, 06:40:51 am »
Does this mod also put the message within the text area box of the text message on the send email page?
or does it just parse the remove link in the email after you send it out

I need to include mre than just the remove link i have a whole statement i have to add to the footer.

Would be nice if the script had an option for custom footers for every email..

Justin Thomas

  • Guest
Re: Making !remove automatic on all emails
« Reply #3 on: July 12, 2012, 09:56:28 am »
i added this code to my script

did not auto add remove to my emails

so i edited emailconf.php and edited the code there but it doesnt seem to use the 1

so then i went into the db and found the lmcodes table and found the text it uses for remove

my footer disclaimer is more than 1 line and i have tried \n for line breaks

but its echoing that within the emails. 

how else can i make the text have character spacing??

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
Re: Making !remove automatic on all emails
« Reply #4 on: November 16, 2012, 05:49:21 am »
Justin,

Custom Text message codes should be processed before other codes, so you could set up a footer in one of those and include a Remove Link code in it.  Then you would simply use the one code at the end of your messages.  If there are any problems with that, you'd have to use two codes.  While it may be possible to set up a hack to automatically add codes or text, it can't be recommended or supported.  To put you on the right track, you might add to the message body before the call to the processmsg() function in admin.php.

As of v1.88, that occurs on line 2411:

Code: [Select]
list($xsubj,$xmsg,$xhtmsg)=processmsg($userid,$subj,$msg,$htmsg,'0',$typ,$list);
 So before that you might put:

Code: [Select]
$msg.="!custom";
$htmsg.="!custom";

This will add the !custom code to both the text and HTML message bodies.  The code will then be processed by the processmsg() function call on the next line.

\n's should be interpreted properly if between double quotes within PHP script.  If using single quotes they will not be interpreted.  When editing a message code within ListMailPRO simply hit Enter to add a line break.

This modification may have unforeseen consequences with certain messages or notifications and cannot be guaranteed to work as expected.

Regards,

Dean
« Last Edit: November 16, 2012, 05:56:20 am by DW »
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting