Jump to content

(SL) Email actions


Slimer

Recommended Posts

Many users has bad email: account deleted, user suspended, no space in mailbox etc. Your mails to this users back to you with errors.

This is advanced version of (SL) Force users to change email

Features:

  • Make users unapproved until they did not change their email address
  • To users with bad emails did not send any emails
  • Approving emails by users
  • Move users to selected group
  • Log all actions

All you need for work is bad emails list.

 

How to get users list with bad emails?

1. Manually: see your mailer-daemon letters

2. You can use special services

2. Auto: in mail error.log

i am doing like this:

#BAD EMAILS
cat mail.log|grep "user is terminated\|No such user\|account is disabled\|The email account that you tried to reach does not exist" >mail.log.badmails
cat mail.log.badmails|cut -d " " -f1,2|uniq -c >mail.log.badmails.stats
sed -E "s/[[:space:]]+/ /g" mail.log.badmails|cut -d " " -f7|sort|uniq -c|sort -n -r|sed 's/to=<//g'|sed 's/>,//g'|sed 's/    //g' >mail.log.badmails.to.stats
sed -E "s/[[:space:]]+/ /g" mail.log.badmails|cut -d " " -f7|sort|uniq -c|sort -n -r|sed 's/.*to=<//g'|sed 's/>,//g' >mail.log.badmails.list

You get file mail.log.badmails.list where all your bad mails listed.

Just copy-paste into config. Thats all.

 

pic_8.jpgpic_14.thumb.jpg.b7eb6112701250855458630b57788dbb.jpgpic_9.jpg

pic_10.jpgpic_7.jpg

 

Link to comment
On 09.02.2017 at 0:46 AM, NoGi said:

How does this work if you use a 3rd party like SparkPost to do all the emails? My local logs wouldn't have any errors?

No matter which system you are using. This is just stop mailing to users with bad emails.

On 12.02.2017 at 1:21 AM, AlexWebsites said:

Can you change some of the language you are using?

What you want to change?

Link to comment
1 minute ago, Slimer said:

No matter which system you are using. This is just stop mailing to users with bad emails.

Sorry, this is the part I am having trouble understanding. How does it get the bad email list if emails are sent via 3rd party gateway like SparkPost?

Link to comment

Slimer, when you say "To users with bad emails did not send any emails" do you mean that the plugin is stopping the Invision Forums software from generating any emails to the users whose email addresses were copy-pasted into config?

For example, a user with a bad email address might be "following" a particular forum and specified that he wants a single email each day with all new content in that forum from that day. Does your plugin stop that email from going out? (This would be a good thing.)

Link to comment
11 hours ago, Dave Baker said:

Does your plugin stop that email from going out?

Yes, it stops all outgoing emails for that users.

But in this plugin you do not need to have this addresses in config (like in Force users to change email). Once you run it - users marks as unapproved and all emails to this users stops sending.

Link to comment
5 hours ago, Slimer said:

Yes, it stops all outgoing emails for that users.

But in this plugin you do not need to have this addresses in config (like in Force users to change email). Once you run it - users marks as unapproved and all emails to this users stops sending.

How does it automatically mark them? I'm using Amazon SES SMTP currently. I understand about the force users plugin and having to enter a list, but this one does it automatically by the bounce back?

Link to comment

AlexWebsites, to change that phrase you want to use the Admin Control Panel to change and resave a particular template.

Here are the contents of the default template for version 1.0.0 of the plugin ( Admin CP -> Customization -> Themes -> </> -> templates -> core -> global -> plugins -> notValidated3 ):

<section class='ipsType_center ipsPad'>
    <br><br>
    <i class='ipsType_huge fa fa-envelope'></i>
    <h1 class='ipsType_veryLarge'>Change your email!</h1>

    <p class='ipsType_large'>
        Your e-mail <b>{{$mail = \IPS\Member::loggedIn()->email;}}{$mail}</b> not working!
    </p>
    <p class='ipsType_large'>
        For working with our site you must use only working email address!
    </p>
    <hr class='ipsHr'>
  <p class='ipsType_normal'>
        <a href='{url="app=core&module=system&controller=register&do=changeEmail" seoTemplate="register"}' data-ipsDialog data-ipsDialog-size='narrow' data-ipsDialog-title='{lang="reg_change_email"}' data-ipsDialog-modal='true' class='ipsButton ipsButton_light ipsButton_verySmall'>{lang="reg_change_email"}</a>
        <a href='{url="app=core&module=system&controller=login&do=logout" csrf="true" seoTemplate="logout"}' class='ipsButton ipsButton_light ipsButton_verySmall'>{lang="sign_out"}</a>
    </p>
</section>

So you'd want to change "For working with our site you must use only working email address!" to be anything else you'd prefer, and then click the Save button.

I decided to soften some of the other language, too. Here is my version of the template:

<section class='ipsPad'>
    <br>
    <br>
    <i class='ipsType_huge fa fa-envelope'></i>
    <h1 class='ipsType_veryLarge'>Please Change Your Email Address</h1>

    <p class='ipsType_large'>
    Email to this address is undeliverable:
    <br><b>{{$mail = \IPS\Member::loggedIn()->email;}}{$mail}</b>
    </p>

    <p class='ipsType_large'>
    A working email address is required before you can sign in
    as a registered member. Please click on the button
    below to change to a working email address.
    </p>

    <p class='ipsType_normal'>
    (We never disclose your email address or send marketing materials.
    Your email address is needed in case we need to contact
    you, or in case you choose to "follow" a particular topic or
    forum.)
    </p>

    <hr class='ipsHr'>

    <p class='ipsType_normal'>
    <a href='{url="app=core&module=system&controller=register&do=changeEmail" seoTemplate="register"}' data-ipsDialog data-ipsDialog-size='narrow' data-ipsDialog-title='{lang="reg_change_email"}' data-ipsDialog-modal='true' class='ipsButton ipsButton_light ipsButton_verySmall'>{lang="reg_change_email"}</a>
    <a href='{url="app=core&module=system&controller=login&do=logout" csrf="true" seoTemplate="logout"}' class='ipsButton ipsButton_light ipsButton_verySmall'>{lang="sign_out"}</a>
    </p>
</section>

Link to comment
7 hours ago, Slimer said:

Yes, it stops all outgoing emails for that users.

Wonderful! Thanks!

This is the perfect way to stop notification emails that otherwise would continue to go out to the non-working email addresses. The notification emails (when someone posts a reply into a topic that the registered user is following, for example) can cause penalties against my site when Cisco or other anti-spam monitoring services detect that my site is sending emails to non-working email addresses at their corporate customers (usually because the registered user is no longer employed by their corporate customer).

Link to comment
20 hours ago, Slimer said:

No, you must insert bad emails in config manually.

So this difference between both your apps is that the enhanced one puts them in a user group or puts them into the unverified user group as if they first registered? Does it move them back after they verify their new email?

I am using a newsletter app from Headstand, is anyone using this with that and will it prevent outgoing emails with that app also or just default bulk and internal IPS mail?

Link to comment
3 hours ago, AlexWebsites said:

So this difference between both your apps is that the enhanced one puts them in a user group or puts them into the unverified user group as if they first registered?

No, as if they change email. And this one do it for all addresses in config then you press "Start". First one do it when member logging in.

3 hours ago, AlexWebsites said:

Does it move them back after they verify their new email?

I'm working on this feature.

3 hours ago, AlexWebsites said:

I am using a newsletter app from Headstand, is anyone using this with that and will it prevent outgoing emails with that app also or just default bulk and internal IPS mail?

If this app using build in IPS mail send, then it will prevent all outgoing emails.

Link to comment
On 2/17/2017 at 1:36 AM, Slimer said:

No, as if they change email. And this one do it for all addresses in config then you press "Start". First one do it when member logging in.

I'm working on this feature.

If this app using build in IPS mail send, then it will prevent all outgoing emails.

OK thanks. The developer of the newsletter app is using built in IPS mail functions.

 

Link to comment
2 hours ago, Adam_S said:

It says add it to config, but what config and where?

Admin CP - Plugins - (SL) Email actions - Config button

You must insert in config bad emails manually (see screenshots). You can grab it from your mail.log with my script from description.

Link to comment
  • 2 weeks later...
18 hours ago, AlexWebsites said:

Looks like that code is for an entire server. If you are on a hosted solution, you may not be able to run that. I run a server with multiple accounts, so the output would be for the entire server's emails.

You can apply this to your site's mail.log

If you have entire server log - this is not problem too. Actions completed for your users emails only.

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...