Repository: Ombi-app/Ombi (2026-07-09T14:53:02Z)

Issue:
All users variables in MassEmail with BCC default to the first valid user
### Summary

When sending a MassEmail with BCC and personalized user tags inside the template, the variables (i.e. Alias, UserName, etc.) are set to the first user in the list for all users.

https://github.com/Ombi-app/Ombi/blob/cfe2b6ac0f51b5c8b87306cc90e5509b46e8fbc5/src/Ombi.Core/Senders/MassEmailSender.cs#L106

### Ombi Version

4.47.1

### What platform(s) does this occur on?

Docker

### What database are you using?

SQLite (Default)

### Relevant log output

```shell

```


Discussion:

Patch:
diff --git a/src/Ombi.Core/Senders/MassEmailSender.cs b/src/Ombi.Core/Senders/MassEmailSender.cs
index 106a63f49f..3c7db44993 100644
--- a/src/Ombi.Core/Senders/MassEmailSender.cs
+++ b/src/Ombi.Core/Senders/MassEmailSender.cs
@@ -103,10 +103,8 @@ private async Task SendBccMails(MassEmailModel model, CustomizationSettings cust
                 return;
             }
 
-            var firstUser = validUsers.FirstOrDefault();
-
             var bccAddress = string.Join(',', validUsers.Select(x => x.Email));
-            curlys.Setup(firstUser, customization);
+            curlys.Setup(new OmbiUser { UserName = "User", Alias = "User" }, customization);
             var template = new NotificationTemplates() { Message = model.Body, Subject = model.Subject };
             var content = resolver.ParseMessage(template, curlys);
             var msg = new NotificationMessage


Test patch:
diff --git a/src/Ombi.Core.Tests/Senders/MassEmailSenderTests.cs b/src/Ombi.Core.Tests/Senders/MassEmailSenderTests.cs
index bdd9899a72..80c3bcaef9 100644
--- a/src/Ombi.Core.Tests/Senders/MassEmailSenderTests.cs
+++ b/src/Ombi.Core.Tests/Senders/MassEmailSenderTests.cs
@@ -149,7 +149,7 @@ public async Task SendMassEmail_Bcc()
         {
             var model = new MassEmailModel
             {
-                Body = "Test",
+                Body = "Test {Alias} {UserName}",
                 Subject = "Subject",
                 Bcc = true,
                 Users = new List<OmbiUser>
@@ -182,7 +182,7 @@ public async Task SendMassEmail_Bcc()
             var result = await _subject.SendMassEmail(model);
 
             _mocker.Verify<IEmailProvider>(x => x.SendAdHoc(It.Is<NotificationMessage>(m => m.Subject == model.Subject
-            && m.Message == model.Body
+            && m.Message == "Test User User"
             && m.Other["bcc"] == "Test@test.com,b@test.com"), It.IsAny<EmailNotificationSettings>()), Times.Once);
         }