jenkins-bot has submitted this change and it was merged.

Change subject: Add the possibility to send a rejection email
......................................................................


Add the possibility to send a rejection email

Change-Id: Idd476f842fbe8df99bb5b1b2b41963a46add06ce
---
M TranslateSandbox.i18n.php
M api/ApiTranslateSandbox.php
M utils/TranslateSandbox.php
3 files changed, 26 insertions(+), 0 deletions(-)

Approvals:
  Nikerabbit: Looks good to me, approved
  jenkins-bot: Verified

Objections:
  Siebrand: There's a problem with this change, please improve



diff --git a/TranslateSandbox.i18n.php b/TranslateSandbox.i18n.php
index 4097440..18b65ab 100644
--- a/TranslateSandbox.i18n.php
+++ b/TranslateSandbox.i18n.php
@@ -48,6 +48,16 @@
 
 {{GENDER:$3|$3}},
 {{SITENAME}} staff',
+       'tsb-email-rejected-subject' => 'Your application to be a translator at 
{{SITENAME}} was rejected',
+       'tsb-email-rejected-body' => 'Hi {{GENDER:$1|$1}},
+
+I regret to inform you that I had to reject your application to become a 
translator at {{SITENAME}}, because you did not provide any example translation 
that seems valid.
+
+If you are a well-intentioned translator that got rejected by mistake, you are 
welcome to become a translator at {{SITENAME}} again. Please sign up here:
+$2
+
+{{GENDER:$3|$3}},
+{{SITENAME}} staff',
 
        'tsb-request-count' => '$1 {{PLURAL:$1|request|requests}}',
        'tsb-all-languages-button-label' => 'All languages',
@@ -113,6 +123,14 @@
        'tsb-request-count' => 'Label showing number of requests. Parameters:
 * $1 - number of requests
 {{Identical|Request}}',
+       'tsb-email-rejected-subject' => 'The subject for an email that 
announces that a user\'s request to become a translator was rejected.',
+       'tsb-email-rejected-body' => 'The body text for an email that announces 
that a user\'s request to become a translator was rejected. Parameters:
+* $1 - the username of the new user whose request was rejected
+* $2 - the URL to Special:MainPage at the website
+* $3 - the username of the administrator who promoted the user',
+       'tsb-request-count' => 'Label showing number of requests. Parameters:
+* $1 - number of requests
+{{Identical|Request}}',
        'tsb-all-languages-button-label' => 'Button label for filtering the 
requests by language.
 {{Identical|All languages}}',
        'tsb-search-requests' => 'Placeholder text for request search box on 
top of [[Special:TranslateSandbox]].',
diff --git a/api/ApiTranslateSandbox.php b/api/ApiTranslateSandbox.php
index a964a22..2237015 100644
--- a/api/ApiTranslateSandbox.php
+++ b/api/ApiTranslateSandbox.php
@@ -89,6 +89,8 @@
                        $user = User::newFromId( $user );
                        $userpage = $user->getUserPage();
 
+                       TranslateSandbox::sendEmail( $this->getUser(), $user, 
'rejection' );
+
                        try {
                                TranslateSandbox::deleteUser( $user );
                        } catch ( MWException $e ) {
diff --git a/utils/TranslateSandbox.php b/utils/TranslateSandbox.php
index 0b7dec2..2046b45 100644
--- a/utils/TranslateSandbox.php
+++ b/utils/TranslateSandbox.php
@@ -148,6 +148,12 @@
                                $targetSpecialPage = 'Translate';
 
                                break;
+                       case 'rejection':
+                               $subjectMsg = 'tsb-email-rejected-subject';
+                               $bodyMsg = 'tsb-email-rejected-body';
+                               $targetSpecialPage = 'MainPage';
+
+                               break;
                        default:
                                throw new MWException( "'$type' is an invalid 
type of translate sandbox email" );
                }

-- 
To view, visit https://gerrit.wikimedia.org/r/102446
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Idd476f842fbe8df99bb5b1b2b41963a46add06ce
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Amire80 <[email protected]>
Gerrit-Reviewer: Amire80 <[email protected]>
Gerrit-Reviewer: Nikerabbit <[email protected]>
Gerrit-Reviewer: PleaseStand <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to