Skip to content

Commit

Permalink
feat: Allow support via email (#914)
Browse files Browse the repository at this point in the history
  • Loading branch information
M123-dev authored Jan 13, 2022
1 parent c5ea875 commit 894dec0
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 12 deletions.
5 changes: 5 additions & 0 deletions packages/smooth_app/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" />
</intent>
<!-- For sending e-mail's -->
<intent>
<action android:name="android.intent.action.SEND" />
<data android:mimeType="*/*" />
</intent>
</queries>


Expand Down
10 changes: 1 addition & 9 deletions packages/smooth_app/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,7 @@
<array>
<string>https</string>
<string>http</string>
<string>googlegmail</string>
<string>x-dispatch</string>
<string>readdle-spark</string>
<string>airmail</string>
<string>ms-outlook</string>
<string>ymail</string>
<string>fastmail</string>
<string>superhuman</string>
<string>protonmail</string>
<string>mailto</string>
</array>
</dict>
</plist>
3 changes: 3 additions & 0 deletions packages/smooth_app/lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
"@username_or_email": {
"description": "Text field hint for password reset"
},

"reset_password_done": "An e-mail with a link to reset your password has been sent to the e-mail address associated with your account. Also check your spam",
"send_reset_password_mail": "Change password",
"@send_reset_password_mail": {
Expand Down Expand Up @@ -188,6 +189,8 @@
"@support": {
"description": "Button label: Opens a pop up window where all ways to get support are shown"
},
"support_join_slack": "Ask for help in our Slack channel",
"support_via_email": "Send us a e-mail",
"termsOfUse": "Terms of use",
"@termsOfUse": {},
"about_this_app": "About this app",
Expand Down
40 changes: 37 additions & 3 deletions packages/smooth_app/lib/pages/user_preferences_settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import 'package:smooth_app/pages/abstract_user_preferences.dart';
import 'package:smooth_app/themes/smooth_theme.dart';
import 'package:smooth_app/themes/theme_provider.dart';
import 'package:smooth_app/views/bottom_sheet_views/user_contribution_view.dart';
import 'package:smooth_ui_library/buttons/smooth_main_button.dart';
import 'package:smooth_ui_library/buttons/smooth_simple_button.dart';
import 'package:smooth_ui_library/dialogs/smooth_alert_dialog.dart';
import 'package:smooth_ui_library/widgets/smooth_list_tile.dart';
Expand Down Expand Up @@ -102,9 +103,42 @@ class UserPreferencesSettings extends AbstractUserPreferences {
),
SmoothListTile(
text: appLocalizations.support,
leadingWidget: const Icon(Icons.launch),
onPressed: () => LaunchUrlHelper.launchURL(
'https://slack.openfoodfacts.org/', false),
onPressed: () {
showDialog<void>(
context: context,
builder: (BuildContext context) => SmoothAlertDialog(
close: false,
body: Column(
children: <Widget>[
SmoothMainButton(
important: false,
text: appLocalizations.support_join_slack,
onPressed: () {
LaunchUrlHelper.launchURL(
'https://slack.openfoodfacts.org/',
false,
);
},
),
const SizedBox(height: 20),
SmoothMainButton(
important: false,
text: appLocalizations.support_via_email,
onPressed: () async {
final PackageInfo packageInfo =
await PackageInfo.fromPlatform();
LaunchUrlHelper.launchURL(
// TODO(M123): Change subject name when we have a different app name
'mailto:contact@openfoodfacts.org?subject=Smoothie%20help&body=Version:${packageInfo.version}',
false,
);
},
),
],
),
),
);
},
),
SmoothListTile(
text: appLocalizations.about_this_app,
Expand Down

0 comments on commit 894dec0

Please sign in to comment.