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: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 {
|
||||
static const String _functionName = 'send-email';
|
||||
static final RegExp _emailRegex = RegExp(r'^[^@\s]+@[^@\s]+\.[^@\s]+$');
|
||||
@@ -19,6 +28,7 @@ class EmailService {
|
||||
required String text,
|
||||
String? html,
|
||||
String? replyTo,
|
||||
EmailSenderAccount account = EmailSenderAccount.ordini,
|
||||
}) async {
|
||||
final cleanedTo = to.trim();
|
||||
final cleanedSubject = subject.trim();
|
||||
@@ -54,6 +64,7 @@ class EmailService {
|
||||
'to': cleanedTo,
|
||||
'subject': cleanedSubject,
|
||||
'text': cleanedText,
|
||||
'account': account.value,
|
||||
if (html != null && html.trim().isNotEmpty) 'html': html.trim(),
|
||||
if (replyTo != null && replyTo.trim().isNotEmpty)
|
||||
'replyTo': replyTo.trim(),
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
name: flux
|
||||
description: "Gestione attività negozio di telefonia"
|
||||
publish_to: 'none'
|
||||
version: 2.7.0+95
|
||||
version: 2.7.1+96
|
||||
|
||||
environment:
|
||||
sdk: ^3.11.3
|
||||
|
||||
Reference in new issue
Block a user