Comment désactiver le courrier pour les utilisateurs en phase de préparation ?

Continuing the discussion from Description of various user states in Discourse (Admin / Moderator / Staff / Developer / Other ):

I’ve got a forum that includes a Google Groups import. For Reasons, the intention is that this will be a static archive of the Google Group. The Google Group will continue to function standalone and the forum will simply include its posts as static archived data. Right now, I’m doing that by periodically running the Google Import script, but think that I’ll soon instead configure incoming mail and subscribe the category to the Google Group list.

I have turned off enabled staged users. The users all show as active=false and staged=true.

If someone replies to a post, they get an email.

If someone PMs them, they get an email.

If I change the user’s staged status to false, they no longer get PMs, but they do still get notifications about replies to their messages. This seems like a fine behavior, and exactly what someone else was asking about just today, but this entity believes that they do not have permission to email these Google Groups users who have not created an account on the forum.

Maybe I can modify the import script and/or make a plugin that will do something like make all active=false users automatically set to staged=false? Maybe I set the archive category so that it cannot be watched (in a plugin, I guess)?

For the record, here’s how staged users are supposed to be treated:

2 « J'aime »

Continuing the discussion from How to disable mail for staged users?:

Well, I didn’t figure out a way to keep staged users from getting email, so I guess I’ll do

def no_mail_for_staged_users
  staged=User.where(staged: true)
  staged.all.each do |user|
    o=UserOption.find_by(user_id: user.id)
    o.email_level = 2
    o.email_messages_level = 2
    o.email_digests = false
    o.save
  end
end

and modify the mbox script to similarly disable email for the staged users that it creates.

If anyone has any better ideas, I’d be interested to hear.

Are you on latest? There was a bug around staged users getting email that we fixed in the last week or two.

2 « J'aime »

That would be good. I’ll check on Monday and see about undoing the user option changes.

1 « J'aime »

Existe-t-il un plugin pour cela ?

Ceci est un sujet très ancien et ce que je faisais lorsque j’ai écrit ceci n’est plus possible.

Il semble que j’aie ajouté cette fonction au script qui importait les utilisateurs. Si c’est quelque chose que vous voulez faire pour une raison quelconque, vous aurez probablement besoin d’un plugin pour le faire. Décrivez ce qui se passe et qui crée les utilisateurs mis en scène et qui ne devraient pas recevoir d’e-mail ; vous devrez probablement mettre à jour ce qui fait cela pour exécuter un script comme celui que j’ai inclus. Si vous avez besoin d’un plugin personnalisé pour cela, vous pouvez poster dans Marketplace ou me contacter directement.

1 « J'aime »