feat: add sender account support to email service and bump version to 2.7.1+96
Build and Release FLUX (Multi-Platform) / build-web (push) Successful in 2m7s
Build and Release FLUX (Multi-Platform) / build-macos (push) Successful in 2m30s
Build and Release FLUX (Multi-Platform) / build-linux (push) Successful in 1m56s
Build and Release FLUX (Multi-Platform) / build-windows (push) Successful in 8m26s
Build and Release FLUX (Multi-Platform) / build-web (push) Successful in 2m7s
Build and Release FLUX (Multi-Platform) / build-macos (push) Successful in 2m30s
Build and Release FLUX (Multi-Platform) / build-linux (push) Successful in 1m56s
Build and Release FLUX (Multi-Platform) / build-windows (push) Successful in 8m26s
This commit is contained in:
1 parent
1fbd2bf8db
commit
6296f49737
2 files changed
+12
-1
No files matched your search
@@ -4,6 +4,15 @@ import 'package:flutter/foundation.dart';
|
|||||||
import 'package:flux/core/services/email/email_response_model.dart';
|
import 'package:flux/core/services/email/email_response_model.dart';
|
||||||
import 'package:supabase_flutter/supabase_flutter.dart';
|
import 'package:supabase_flutter/supabase_flutter.dart';
|
||||||
|
|
||||||
|
/// Account mittente configurato sulla Edge Function `send-email`.
|
||||||
|
enum EmailSenderAccount {
|
||||||
|
ordini('ordini'),
|
||||||
|
assistenza('assistenza');
|
||||||
|
|
||||||
|
final String value;
|
||||||
|
const EmailSenderAccount(this.value);
|
||||||
|
}
|
||||||
|
|
||||||
class EmailService {
|
class EmailService {
|
||||||
static const String _functionName = 'send-email';
|
static const String _functionName = 'send-email';
|
||||||
static final RegExp _emailRegex = RegExp(r'^[^@\s]+@[^@\s]+\.[^@\s]+$');
|
static final RegExp _emailRegex = RegExp(r'^[^@\s]+@[^@\s]+\.[^@\s]+$');
|
||||||
@@ -19,6 +28,7 @@ class EmailService {
|
|||||||
required String text,
|
required String text,
|
||||||
String? html,
|
String? html,
|
||||||
String? replyTo,
|
String? replyTo,
|
||||||
|
EmailSenderAccount account = EmailSenderAccount.ordini,
|
||||||
}) async {
|
}) async {
|
||||||
final cleanedTo = to.trim();
|
final cleanedTo = to.trim();
|
||||||
final cleanedSubject = subject.trim();
|
final cleanedSubject = subject.trim();
|
||||||
@@ -54,6 +64,7 @@ class EmailService {
|
|||||||
'to': cleanedTo,
|
'to': cleanedTo,
|
||||||
'subject': cleanedSubject,
|
'subject': cleanedSubject,
|
||||||
'text': cleanedText,
|
'text': cleanedText,
|
||||||
|
'account': account.value,
|
||||||
if (html != null && html.trim().isNotEmpty) 'html': html.trim(),
|
if (html != null && html.trim().isNotEmpty) 'html': html.trim(),
|
||||||
if (replyTo != null && replyTo.trim().isNotEmpty)
|
if (replyTo != null && replyTo.trim().isNotEmpty)
|
||||||
'replyTo': replyTo.trim(),
|
'replyTo': replyTo.trim(),
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
name: flux
|
name: flux
|
||||||
description: "Gestione attività negozio di telefonia"
|
description: "Gestione attività negozio di telefonia"
|
||||||
publish_to: 'none'
|
publish_to: 'none'
|
||||||
version: 2.7.0+95
|
version: 2.7.1+96
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.11.3
|
sdk: ^3.11.3
|
||||||
|
|||||||
Reference in new issue
Block a user