Fix issues

This commit is contained in:
Henry Hiles 2025-08-03 00:55:00 -04:00
commit 3eb61e3107
No known key found for this signature in database
2 changed files with 40 additions and 20 deletions

View file

@ -76,18 +76,19 @@ void main(List<String> argsRaw) async {
"✉️ Sending...",
);
final from = mail.MailAddress(settings.mailName, settings.email);
final mailClient = await container.read(
MailClientController.provider.future,
);
await mailClient.sendMessageBuilder(
mail.MessageBuilder.prepareMultipartAlternativeMessage(
plainText:
"""Your registration for Federated Nexus has been accepted! Your credentials are:
await container
.read(MailClientController.provider.notifier)
.sendMessage(
plainText:
"""Your registration for Federated Nexus has been accepted! Your credentials are:
Username: ${registration.username}.
Password: $password""",
htmlText: markdownToHtml(
"""# Your registration for Federated Nexus has been accepted!
Password: $password
If you have any questions, check out our documentation: https://federated.nexus/services/matrix/.
If you have any issues, reply to this email.""",
markdown:
"""# Your registration for Federated Nexus has been accepted!
## Your credentials are:
- ### Username: ${registration.username}.
- ### Password: $password
@ -95,14 +96,11 @@ Password: $password""",
If you have any questions, check out [our documentation](https://federated.nexus/services/matrix/).
If you have any issues, reply to this email.""",
),
)..subject = "Your registration for Federated Nexus has been accepted!",
from: from,
recipients: [
mail.MailAddress(registration.username, registration.email),
],
);
subject:
"Your registration for Federated Nexus has been accepted!",
from: mail.MailAddress(settings.mailName, settings.email),
to: mail.MailAddress(registration.username, registration.email),
);
await event.room.redactEvent(reactionEvent!);
await event.room.sendReaction(event.eventId, "✉️ Sent!");
}
@ -114,7 +112,9 @@ If you have any issues, reply to this email.""",
(Router()..post("/", (Request request) async {
final body = await request.readAsString();
final registration = Registration.fromJson(
Uri.splitQueryString(body),
Uri.splitQueryString(
body,
).map((key, value) => MapEntry(key, value.toLowerCase())),
);
final client = await container.read(