properly name purge emails/email logs site settings

This commit is contained in:
Régis Hanol 2016-02-08 22:18:52 +01:00
parent 49e55652bd
commit 460665895c
24 changed files with 28 additions and 28 deletions

View file

@ -4,9 +4,9 @@ module Jobs
every 1.day
def execute(args)
return if SiteSetting.suppress_email_logs_after_days <= 0
return if SiteSetting.delete_email_logs_after_days <= 0
threshold = SiteSetting.suppress_email_logs_after_days.days.ago
threshold = SiteSetting.delete_email_logs_after_days.days.ago
EmailLog.where(reply_key: nil)
.where("created_at < ?", threshold)

View file

@ -19,7 +19,7 @@ module Jobs
.not_suspended
.where("COALESCE(last_emailed_at, '2010-01-01') <= CURRENT_TIMESTAMP - ('1 DAY'::INTERVAL * digest_after_days)")
.where("COALESCE(last_seen_at, '2010-01-01') <= CURRENT_TIMESTAMP - ('1 DAY'::INTERVAL * digest_after_days)")
.where("COALESCE(last_seen_at, '2010-01-01') >= CURRENT_TIMESTAMP - ('1 DAY'::INTERVAL * #{SiteSetting.suppress_digest_email_after_days})")
.where("COALESCE(last_seen_at, '2010-01-01') >= CURRENT_TIMESTAMP - ('1 DAY'::INTERVAL * #{SiteSetting.delete_digest_email_after_days})")
# If the site requires approval, make sure the user is approved
if SiteSetting.must_approve_users?

View file

@ -1136,7 +1136,7 @@ ar:
automatically_download_gravatars: "تحميل Gravatars للأعضاء عند تغيرهم البريد الإلكتروني الخاص بهم أو عند إنشائهم لحساب آخر."
digest_topics: "العدد الاقصي من المواضيع لعرضها في مضمون البريد الإلكتروني "
digest_min_excerpt_length: "الحد الادني من مشاركه مقتطفات خلاصه البريد الاكتروني,في الشخصيات"
suppress_digest_email_after_days: "احفظ خلاصه الرسائل الالكترونيه للمستخدمين الذين لم تتم رويتهم في الموقع لاكثر من (N) ايام"
delete_digest_email_after_days: "احفظ خلاصه الرسائل الالكترونيه للمستخدمين الذين لم تتم رويتهم في الموقع لاكثر من (N) ايام"
disable_digest_emails: "عطل ملخص رسائل البريد الإلكتروني لكل الأعضاء."
detect_custom_avatars: "سواء او لا تفقد اذا كان المستخدم قام بتحميل صور شخصيه مخصصه"
max_daily_gravatar_crawls: "العدد الاقصي من مرات Dicourse سوف يتفقد Gravatar لصور رمزيه مخصصه في اليوم"

View file

@ -969,7 +969,7 @@ de:
automatically_download_gravatars: "Avatare von Gravatar herunterladen, wenn ein Nutzer sich registriert oder seine E-Mail-Adresse ändert."
digest_topics: "Maximale Anzahl von Themen, die in der E-Mail-Zusammenfassung angezeigt werden."
digest_min_excerpt_length: "Minimale Länge des Auszugs aus einem Beitrag in der E-Mail-Zusammenfassung, in Zeichen."
suppress_digest_email_after_days: "Sende keine E-Mail-Zusammenfassungen an Benutzer, die die Seite seit mehr als (n) Tagen nicht mehr besucht haben."
delete_digest_email_after_days: "Sende keine E-Mail-Zusammenfassungen an Benutzer, die die Seite seit mehr als (n) Tagen nicht mehr besucht haben."
disable_digest_emails: "E-Mail-Zusammenfassungen für alle Benutzer deaktivieren."
detect_custom_avatars: "Aktiviere diese Option, um zu überprüfen, ob Benutzer eigene Profilbilder hochgeladen haben."
max_daily_gravatar_crawls: "Wie oft pro Tag Discourse höchstens auf Gravatar nach benuterdefinierten Avataren suchen soll."

View file

@ -1116,7 +1116,7 @@ en:
unsubscribe_via_email: "Allow users to unsubscribe from emails by sending an email with 'unsubscribe' in the subject or body"
unsubscribe_via_email_footer: "Attach an unsubscribe link to the footer of sent emails"
suppress_email_logs_after_days: "Delete email logs after (N) days. 0 to keep indefinitely"
delete_email_logs_after_days: "Delete email logs after (N) days. 0 to keep indefinitely"
pop3_polling_enabled: "Poll via POP3 for email replies."
pop3_polling_ssl: "Use SSL while connecting to the POP3 server. (Recommended)"
@ -1147,7 +1147,7 @@ en:
automatically_download_gravatars: "Download Gravatars for users upon account creation or email change."
digest_topics: "The maximum number of topics to display in the email digest."
digest_min_excerpt_length: "Minimum post excerpt in the email digest, in characters."
suppress_digest_email_after_days: "Suppress digest emails for users not seen on the site for more than (n) days."
delete_digest_email_after_days: "Suppress digest emails for users not seen on the site for more than (n) days."
disable_digest_emails: "Disable digest emails for all users."
detect_custom_avatars: "Whether or not to check that users have uploaded custom profile pictures."

View file

@ -986,7 +986,7 @@ es:
automatically_download_gravatars: "Descargar Gravatars para usuarios cuando se creen una cuenta o cambien el email."
digest_topics: "El número máximo de temas a mostrar en el resumen por email."
digest_min_excerpt_length: "La extensión mínima, en caracteres, del extracto de un post en el resumen por email."
suppress_digest_email_after_days: "Suprimir los emails de resumen para aquellos usuarios que no han visto el sitio desde más de (n) días."
delete_digest_email_after_days: "Suprimir los emails de resumen para aquellos usuarios que no han visto el sitio desde más de (n) días."
disable_digest_emails: "Inhabilitar e-mails de resumen para todos los usuarios."
detect_custom_avatars: "Verificar o no que los usuarios han subido una imagen de perfil."
max_daily_gravatar_crawls: "Máximo número de veces que Discourse comprobará Gravatar en busca de avatares personalizados en un día"

View file

@ -882,7 +882,7 @@ fa_IR:
automatically_download_gravatars: "آواتار را برای کاربران دریافت کن برای ساختن حساب کاربری یا ایمیل. "
digest_topics: "حداکثر تعداد جستارهایی که در دایجست ایمیل نشان داده می شود "
digest_min_excerpt_length: "حداقل نوشته های گزیده در ایمیل دایجست٬‌ در کاراکتر."
suppress_digest_email_after_days: "ایمیل های خلاصه را مهار کن برای کاربرانی که در وب سایت دیده نشده اند بیشتر از (n) روز "
delete_digest_email_after_days: "ایمیل های خلاصه را مهار کن برای کاربرانی که در وب سایت دیده نشده اند بیشتر از (n) روز "
disable_digest_emails: "ایمیل های دایجست را برای تمام کاربران غیر فعال کن. "
max_daily_gravatar_crawls: "حداکثرتعداد زمانی که دیسکورس Gravatar را چک می کند برای آواتار سفارشی در هر روز. "
public_user_custom_fields: "لیست مجاز فیلد سفارشی برای کاربر که می تواند به همه نشان داده شود."

View file

@ -997,7 +997,7 @@ fi:
automatically_download_gravatars: "Lataa käyttäjille Gravatarit automaattisesti tilin luonnin ja sähköpostin vaihdon yhteydessä."
digest_topics: "Sähköpostitiivistelmässä näytettävien ketjujen maksimimäärä."
digest_min_excerpt_length: "Viestin katkelman vähimmäispituus sähköpostitiivistelmässä, merkeissä"
suppress_digest_email_after_days: "Jätä lähettämättä tiivistelmäsähköpostit käyttäjille, joita ei ole nähty (n) päivän aikana."
delete_digest_email_after_days: "Jätä lähettämättä tiivistelmäsähköpostit käyttäjille, joita ei ole nähty (n) päivän aikana."
disable_digest_emails: "Ota tiivistelmäsähköpostit pois käytöstä kaikilta käyttäjiltä."
detect_custom_avatars: "Tarkistetaanko, ovatko käyttäjät ladanneet oman profiilikuvan."
max_daily_gravatar_crawls: "Korkeintaan kuinka monta kertaa Discourse tarkistaa avatarit Gravatarista päivässä"

View file

@ -984,7 +984,7 @@ fr:
automatically_download_gravatars: "Télécharger les gravatars pour les utilisateurs lors de la création de compte ou de la modification de courriel."
digest_topics: "Nombre maximum de sujets à afficher dans le courriel de résumé."
digest_min_excerpt_length: "Taille minimum du résumé des messages dans les courriels, en caractères."
suppress_digest_email_after_days: "Ne pas envoyer de résumés courriel aux utilisateurs qui n'ont pas visité le site depuis (n) jours."
delete_digest_email_after_days: "Ne pas envoyer de résumés courriel aux utilisateurs qui n'ont pas visité le site depuis (n) jours."
disable_digest_emails: "Désactiver les résumés par courriels pour tous les utilisateurs."
detect_custom_avatars: "Vérifier ou non si les utilisateurs ont envoyé une photo de profil personnalisée."
max_daily_gravatar_crawls: "Nombre maximum de fois que Discourse vérifiera Gravatar pour des avatars personnalisés en une journée."

View file

@ -926,7 +926,7 @@ he:
automatically_download_gravatars: "הורדת גראווטרים למשתמשים בעת יצירת החשבון או שינוי כתובת הדוא\"ל."
digest_topics: "מספר הנושאים המקסימלי להצגה במייל סיכום."
digest_min_excerpt_length: "מספר התווים המינימלי למובאות מתוך הפרסום במייל הסיכום."
suppress_digest_email_after_days: "השהיית מיילים מסכמים עבור משתמשים שלא נראו באתר במשך יותר מ(n) ימים."
delete_digest_email_after_days: "השהיית מיילים מסכמים עבור משתמשים שלא נראו באתר במשך יותר מ(n) ימים."
disable_digest_emails: "נטרול דוא\"ל סיכום לכל המשתמשים."
detect_custom_avatars: "Whether or not to check that users have uploaded custom profile pictures."
max_daily_gravatar_crawls: "מספר הפעמים המקסימלי ש-Discourse יבדוק אווטרים ב-Gravatar ביום"

View file

@ -815,7 +815,7 @@ ja:
automatically_download_gravatars: "アカウントの生成時、メールアドレスの変更時にGravatarをダウンロード"
digest_topics: "ダイジェストメールに表示されるトピックの最大数"
digest_min_excerpt_length: "ダイジェストメール内の投稿の抜粋の最小文字数"
suppress_digest_email_after_days: "(n)日以上ユーザが参照していなければダイジェストメールを抑制します"
delete_digest_email_after_days: "(n)日以上ユーザが参照していなければダイジェストメールを抑制します"
disable_digest_emails: "全てのユーザのダイジェストメールを無効にする"
detect_custom_avatars: "ユーザがプロフィール画像をアップロードしたか確認する"
max_daily_gravatar_crawls: "Discourseがプロフィール画像の確認をgravastarに行う回数の上限"

View file

@ -825,7 +825,7 @@ ko:
automatically_download_gravatars: "사용자가 계정을 만들거나 이메일을 변경하자마자 Gravatar를 다운로드합니다."
digest_topics: "요약 이메일에서 보여질 최대 글타래 개수"
digest_min_excerpt_length: "요약 이메일에서 최소 글 발췌 수"
suppress_digest_email_after_days: "(n)일동안 사이트에서 보지 못한 사용자에게는 이메일 요약을 보내지 않습니다."
delete_digest_email_after_days: "(n)일동안 사이트에서 보지 못한 사용자에게는 이메일 요약을 보내지 않습니다."
disable_digest_emails: "모든 유저들 이메일 다이제스트 못하게 하기"
max_daily_gravatar_crawls: "하루에 Discourse가 커스텀 아파타를 위해 Gravatar를 체크하는 최대 횟수"
public_user_custom_fields: "유저가 쓸 수 있는 공개 커스텀 필드 목록"

View file

@ -952,7 +952,7 @@ nl:
automatically_download_gravatars: "Download Gravatars voor gebruikers bij account creatie of aanpassing van email."
digest_topics: "Het maximum aantal topics dat in de e-maildigest opgenomen wordt."
digest_min_excerpt_length: "Hoeveel karakters er per bericht getoond worden in de mail digest"
suppress_digest_email_after_days: "Onderdruk e-mails met korte verslagen voor gebruikers die niet zijn gezien op de site voor meer dan (n) dagen."
delete_digest_email_after_days: "Onderdruk e-mails met korte verslagen voor gebruikers die niet zijn gezien op de site voor meer dan (n) dagen."
disable_digest_emails: "Uitschakelen e-mails met korte verslagen voor alle gebruikers."
detect_custom_avatars: "Wel of niet te verifiëren of gebruikers eigen profielfoto's hebben geüpload. "
max_daily_gravatar_crawls: "Maximaal aantal keren op een dag dat Discourse Gravatar zal controleren voor aangepaste avatars"

View file

@ -811,7 +811,7 @@ pl_PL:
email_editable: "Allow users to change their e-mail address after registration."
digest_topics: "Maksymalna liczba tematów w podsumowaniu e-mail."
digest_min_excerpt_length: "Minimalny wycinek wpisu (liczba znaków) w podsumowaniu e-mail."
suppress_digest_email_after_days: "Nie wysyłaj podsumowań e-mail użytkownikom, którzy nie odwiedzili serwisu dłużej niż (n) dni."
delete_digest_email_after_days: "Nie wysyłaj podsumowań e-mail użytkownikom, którzy nie odwiedzili serwisu dłużej niż (n) dni."
disable_digest_emails: "Wyłącz wysyłanie podsumowania e-mail wszystkim uzytkownikom. "
allow_anonymous_posting: "Zezwól użytkownikom na przechodzenie w tryb anonimowości."
allow_profile_backgrounds: "Zezwól użytkownikom na przesyłanie obrazu tła dla profilu."

View file

@ -991,7 +991,7 @@ pt:
automatically_download_gravatars: "Descarregar Gravatars para os utilizadores após criação de conta ou mudança de email."
digest_topics: "Número máximo de tópicos a serem apresentados no resumo do email."
digest_min_excerpt_length: "Tamanho mínimo do excerto da mensagem no resumo do email, em caracteres."
suppress_digest_email_after_days: "Suprimir emails de resumos para utilizadores não vistos no sítio por mais de (n) dias."
delete_digest_email_after_days: "Suprimir emails de resumos para utilizadores não vistos no sítio por mais de (n) dias."
disable_digest_emails: "Desativar os emails de resumo para todos os utilizadores."
detect_custom_avatars: "Se deve ou não verificar que os utilizadores carregaram fotografias de perfil personalizadas."
max_daily_gravatar_crawls: "Número máximo de vezes que o Discourse irá verificar o Gravatar para avatars personalizados, por dia"

View file

@ -933,7 +933,7 @@ pt_BR:
automatically_download_gravatars: "Fazer download de Gravatars dos usuários ao criar conta ou mudança de email."
digest_topics: "O número máximo de tópicos a serem mostrados no resumo via email."
digest_min_excerpt_length: "O excerto mínimo de post no resumo via email, em caracteres."
suppress_digest_email_after_days: "Suprimir emails de resumo para usuários não vistos no site há mais do que (n) dias."
delete_digest_email_after_days: "Suprimir emails de resumo para usuários não vistos no site há mais do que (n) dias."
disable_digest_emails: "Desabilitar emails de resumo para todos os usuários."
max_daily_gravatar_crawls: "Número máximo de vezes que o Discourse irá checar o Gravatar por avatares personalizados em um dia"
public_user_custom_fields: "Um conjunto de campos personalizados para um usuário que podem ser apresentados publicamente."

View file

@ -948,7 +948,7 @@ ru:
automatically_download_gravatars: "Скачивать аватарку Gravatar пользователя во время создания учетной записи или изменения e-mail."
digest_topics: "Максимальное количество тем в письме - сводке новостей."
digest_min_excerpt_length: "Минимальная длина (в символах) вытяжки из сообщения в письме - сводке новостей."
suppress_digest_email_after_days: "Не рассылать новости для пользователей, которые не заходили на сайт в течении (n) дней."
delete_digest_email_after_days: "Не рассылать новости для пользователей, которые не заходили на сайт в течении (n) дней."
disable_digest_emails: "Отключить рассылку новостей для всех пользователей."
detect_custom_avatars: "Проверять ли, что пользователи загрузили свои собственные картинки профиля (аватарки)."
max_daily_gravatar_crawls: "Максимальное количество загрузок аватаорок с Gravatar за один день"

View file

@ -1033,7 +1033,7 @@ sk:
automatically_download_gravatars: "Po vytvorení účtu alebo zmene heslo stiahnuť používateľov Gravatar."
digest_topics: "Maximálny počet tém, ktoré sa zobrazia v súhrnnom emaile."
digest_min_excerpt_length: "Minimálny výťah príspevku v sumarizačnom emaile, v znakoch."
suppress_digest_email_after_days: "Zakázat súhrnný email používateľom, ktorý neboli na stránkach viac ako (n) dní."
delete_digest_email_after_days: "Zakázat súhrnný email používateľom, ktorý neboli na stránkach viac ako (n) dní."
disable_digest_emails: "Vypnúť sumárny email pre všetkých používateľov."
detect_custom_avatars: "Má alebo nemá sa kontrolovať nahratie vlastného profilového obrázka používateľa?"
max_daily_gravatar_crawls: "Koľkokrát denne má Discourse kontrolovať Gravatar na zistenie vlastného avatara."

View file

@ -889,7 +889,7 @@ sq:
automatically_download_gravatars: "Download Gravatars for users upon account creation or email change."
digest_topics: "The maximum number of topics to display in the email digest."
digest_min_excerpt_length: "Minimum post excerpt in the email digest, in characters."
suppress_digest_email_after_days: "Suppress digest emails for users not seen on the site for more than (n) days."
delete_digest_email_after_days: "Suppress digest emails for users not seen on the site for more than (n) days."
disable_digest_emails: "Disable digest emails for all users."
detect_custom_avatars: "Whether or not to check that users have uploaded custom profile pictures."
max_daily_gravatar_crawls: "Maximum number of times Discourse will check Gravatar for custom avatars in a day"

View file

@ -920,7 +920,7 @@ tr_TR:
automatically_download_gravatars: "Hesap oluşturma veya e-posta değişikliği esnasında kullanıcılar için Gravatarları indir"
digest_topics: "Özet e-postalarda yer alacak en fazla konu sayısı. "
digest_min_excerpt_length: "Özet e-postalarında, gönderi alıntılarında olması gereken en az karakter sayısı."
suppress_digest_email_after_days: "Siteye (n) günden fazla süredir uğramayan kullanıcılar için özet e-posta gönderimini durdur"
delete_digest_email_after_days: "Siteye (n) günden fazla süredir uğramayan kullanıcılar için özet e-posta gönderimini durdur"
disable_digest_emails: "Tüm kullanıcılar için özet e-postalarını devre dışı bırak."
detect_custom_avatars: "Kullanıcıların özel profil resimleri yükleyip yüklemediklerini kontrol et ya da etme."
max_daily_gravatar_crawls: "Discourse'un gün içinde özel avatarlar için Gravatar'ı en fazla kaç kere kontrol edeceği."

View file

@ -944,7 +944,7 @@ zh_CN:
automatically_download_gravatars: "为注册或更改邮箱的用户下载 Gravatar 头像。"
digest_topics: "邮件摘要中显示的最大主题数目。"
digest_min_excerpt_length: "在邮件摘要中每个帖子最少显示的字符数量。"
suppress_digest_email_after_days: "不发送摘要邮件给超过 (n) 天未出现的用户。"
delete_digest_email_after_days: "不发送摘要邮件给超过 (n) 天未出现的用户。"
disable_digest_emails: "为所有用户禁用摘要邮件。"
detect_custom_avatars: "检测用户是否上传了自定义个人头像。"
max_daily_gravatar_crawls: "一天内 Discourse 将自动检查 gravatar 自定义头像的次数"

View file

@ -738,7 +738,7 @@ zh_TW:
automatically_download_gravatars: "當用戶註冊或更改EMail時下載 Gravatars 圖片"
digest_topics: "EMail 摘要中顯示的最大話題數量"
digest_min_excerpt_length: "EMail 摘要中每篇文章最少顯示的字元數量"
suppress_digest_email_after_days: "不發送摘要郵件給超過 (n) 天閒置的用戶。"
delete_digest_email_after_days: "不發送摘要郵件給超過 (n) 天閒置的用戶。"
disable_digest_emails: "禁用發送摘要郵件給所有用戶。"
max_daily_gravatar_crawls: "一天內 Discourse 將自動檢查 Gravatar 自訂個人圖示的次數"
public_user_custom_fields: "用戶可設定公開顯示的自定欄位白名單。"

View file

@ -500,7 +500,7 @@ email:
email_posts_context: 5
digest_min_excerpt_length: 100
digest_topics: 20
suppress_digest_email_after_days: 365
delete_digest_email_after_days: 365
disable_digest_emails:
default: false
client: true
@ -539,7 +539,7 @@ email:
default: true
unsubscribe_via_email_footer:
default: false
suppress_email_logs_after_days:
delete_email_logs_after_days:
default: 365
min: 0

View file

@ -14,8 +14,8 @@ describe Jobs::CleanUpEmailLogs do
expect(EmailLog.count).to eq(3)
end
it "does not remove old email logs when suppress_email_logs_after_days is 0" do
SiteSetting.suppress_email_logs_after_days = 0
it "does not remove old email logs when delete_email_logs_after_days is 0" do
SiteSetting.delete_email_logs_after_days = 0
Jobs::CleanUpEmailLogs.new.execute({})
expect(EmailLog.count).to eq(4)
end