Skip to content

Commit da5752d

Browse files
authored
Merge pull request #21355 from wordpress-mobile/issue/21354-feedback-form-a8c
Warn A8C users when accessing Zendesk
2 parents 854ad77 + 6eded72 commit da5752d

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

WordPress/src/main/java/org/wordpress/android/ui/ActivityLauncher.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
import org.wordpress.android.ui.posts.PostsListActivity;
9696
import org.wordpress.android.ui.posts.RemotePreviewLogicHelper.RemotePreviewType;
9797
import org.wordpress.android.ui.prefs.AccountSettingsActivity;
98+
import org.wordpress.android.ui.prefs.AppPrefs;
9899
import org.wordpress.android.ui.prefs.AppSettingsActivity;
99100
import org.wordpress.android.ui.prefs.BlogPreferencesActivity;
100101
import org.wordpress.android.ui.prefs.MyProfileActivity;
@@ -127,6 +128,7 @@
127128
import org.wordpress.android.util.AppLog;
128129
import org.wordpress.android.util.AppLog.T;
129130
import org.wordpress.android.util.ToastUtils;
131+
import org.wordpress.android.util.ToastUtils.Duration;
130132
import org.wordpress.android.util.UriWrapper;
131133
import org.wordpress.android.util.UrlUtils;
132134
import org.wordpress.android.util.WPActivityUtils;
@@ -1311,6 +1313,7 @@ public static void viewHelp(@NonNull Context context, @NonNull Origin origin, @N
13111313
}
13121314

13131315
public static void viewFeedbackForm(@NonNull Context context) {
1316+
warnIfIdentityA8C(context);
13141317
// TODO verify tracks event with iOS
13151318
AnalyticsTracker.track(Stat.FEEDBACK_FORM_OPENED);
13161319
Intent intent = new Intent(context, FeedbackFormActivity.class);
@@ -1322,6 +1325,17 @@ public static void viewZendeskTickets(@NonNull Context context,
13221325
viewHelpInNewStack(context, Origin.ZENDESK_NOTIFICATION, selectedSite, null);
13231326
}
13241327

1328+
/**
1329+
* Warn A8C users that they can't create Zendesk tickets
1330+
*/
1331+
@NonNull
1332+
public static void warnIfIdentityA8C(@NonNull Context context) {
1333+
String supportEmail = AppPrefs.getSupportEmail();
1334+
if (supportEmail.contains("@automattic.com") || supportEmail.contains("@a8c.com")) {
1335+
ToastUtils.showToast(context, R.string.support_warn_if_user_a8c, Duration.LONG);
1336+
}
1337+
}
1338+
13251339
public static void viewSSLCerts(Context context, String certificateString) {
13261340
Intent intent = new Intent(context, SSLCertsViewActivity.class);
13271341
intent.putExtra(SSLCertsViewActivity.CERT_DETAILS_KEYS, certificateString.replaceAll("\n", "<br/>"));

WordPress/src/main/java/org/wordpress/android/ui/accounts/HelpActivity.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ class HelpActivity : LocaleAwareActivity() {
169169
}
170170

171171
private fun launchSupportWidget() {
172+
ActivityLauncher.warnIfIdentityA8C(this)
172173
val intent = SupportWebViewActivity.createIntent(
173174
this,
174175
originFromExtras,
@@ -179,6 +180,7 @@ class HelpActivity : LocaleAwareActivity() {
179180
}
180181

181182
private fun createNewZendeskTicket() {
183+
ActivityLauncher.warnIfIdentityA8C(this)
182184
zendeskHelper.createNewTicket(
183185
this,
184186
originFromExtras,
@@ -193,6 +195,7 @@ class HelpActivity : LocaleAwareActivity() {
193195
}
194196

195197
private fun showZendeskTickets() {
198+
ActivityLauncher.warnIfIdentityA8C(this)
196199
zendeskHelper.showAllTickets(
197200
this,
198201
originFromExtras,

WordPress/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,6 +1143,7 @@
11431143
<string name="feedback_form_unable_to_create_tempfile">Unable to create temporary file</string>
11441144
<string name="feedback_form_add_attachments">Add attachments</string>
11451145
<string name="feedback_form_note">If you need support, please get in touch using the \"Help &amp; Support\" screen</string>
1146+
<string name="support_warn_if_user_a8c">Automattic email accounts can\'t submit or view support tickets</string>
11461147
<string name="media_pager_remove_item_content_description">Remove item %1$d</string>
11471148

11481149
<!-- activity log -->

0 commit comments

Comments
 (0)