ElkArte Community

Project Support => Support => Topic started by: Steeley on November 17, 2020, 07:34:59 pm

Title: Parsing Unwanted Text in Replies
Post by: Steeley on November 17, 2020, 07:34:59 pm
EMails sent to users have the following text embedded by default..

<> To visit Forum on the web, go to:
    https://forum.site

<
> You can see this message by using this link:
    https://forum.site/index.php?topic=5.msg13#msg13

<> You can go to your first unread message by using this link:
    https://forum.sitel/index.php?topic=5.new;topicseen#new

<
> Unsubscribe to this by using this link:
    https://forum.site/index.php?action=notifyboard;board=40.0

I've attempted to remove it on incoming reply emails, using the parser [Main->Maillist Center-> Parser], but apparently I'm not holding my tongue right. More accurately, I'm not sure what code / format I should be putting in the parser.  Nothing I've tried so far gives me any joy, nor have I found the parser-formatting addressed on the boards here. or in the documentation (did I miss it?).

So, I'll add one more bread crumb..

Also, I'm not sure if I can strip the message ID that follows the above text from the reply text [bba7f55025693216e8ad6ec5f6yaddayaddayadda] with impunity also, or if that will goof stuff up.. If I can strip it without impact, that's ideal..

At the moment I've added signature text instructing members to delete that before replying, but that's not particularly effective, so deleting it automagically on receipt is the more elegant solution.

Can someone edumicate me, please?

Title: Re: Parsing Unwanted Text in Replies
Post by: Spuds on November 20, 2020, 06:15:36 pm
I'd recommend using filters for that, the parsers are to try and "cut" the original message form the reply and all of the above is long after where it should have cut.  Then again you may want the reply so really your choice.  

As an example of a filter, which without testing could also work as a parser, is the following regex

Code: [Select]
~\<\*\>\s+To visit .*? on the web, go to:.*\[url\]http:\/\/www.*?.com\/\[\/url\]~si
with a replacement of nothing would remove that one line (filter) and if used as a parser it should cut the message at that point as well.   Give that a try.
Title: Re: Parsing Unwanted Text in Replies
Post by: Steeley on November 20, 2020, 11:05:11 pm
Thanks for the reply, and the suggestion Spuds .. I learned a little bit more about regex

Actually, the text on my board (and this forum also, so I passed this to the admins), comes through starting with... 

Posting Information: 
yadda yadda


So, "standard" search string in the parser = "Posting Information: "

Finally figured out why nothing I tried worked...

No.. there is not a space after the colon in the reply email text.....  [fap]