mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-23 19:06:42 +02:00
refactor: restructure
monorepo with apps/ and services/ directories
This commit is contained in:
parent
25824ed0ac
commit
ff80aeec1f
4062 changed files with 2592 additions and 1278 deletions
|
|
@ -0,0 +1,42 @@
|
|||
import { Alert, Linking, Platform } from 'react-native';
|
||||
import Constants from 'expo-constants';
|
||||
import { TFunction } from 'i18next';
|
||||
|
||||
interface EmailSupportOptions {
|
||||
userId?: string;
|
||||
t: TFunction;
|
||||
}
|
||||
|
||||
export const openSupportEmail = async ({ userId, t }: EmailSupportOptions) => {
|
||||
const email = 'kontakt@memoro.ai';
|
||||
const subject = 'Support-Anfrage - Memoro App';
|
||||
const body = `Hallo Memoro Team,
|
||||
|
||||
ich benötige Hilfe bei:
|
||||
|
||||
[Beschreibe hier dein Problem]
|
||||
|
||||
Benutzer-ID: ${userId || 'Nicht verfügbar'}
|
||||
App-Version: ${Constants.expoConfig?.version || 'N/A'}
|
||||
Plattform: ${Platform.OS}`;
|
||||
|
||||
const emailUrl = `mailto:${email}?subject=${encodeURIComponent(subject)}&body=${encodeURIComponent(body)}`;
|
||||
|
||||
try {
|
||||
const canOpen = await Linking.canOpenURL(emailUrl);
|
||||
if (canOpen) {
|
||||
await Linking.openURL(emailUrl);
|
||||
} else {
|
||||
Alert.alert(
|
||||
t('settings.email_error', 'E-Mail-App konnte nicht geöffnet werden'),
|
||||
t('settings.email_error_description', 'Bitte sende eine E-Mail an kontakt@memoro.ai')
|
||||
);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Could not open email app:', error);
|
||||
Alert.alert(
|
||||
t('settings.email_error', 'E-Mail-App konnte nicht geöffnet werden'),
|
||||
t('settings.email_error_description', 'Bitte sende eine E-Mail an kontakt@memoro.ai')
|
||||
);
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue