Class LocalProjectNotificationEmailSender
- Namespace
- Builvero.Infrastructure.Services
- Assembly
- Builvero.Infrastructure.dll
Local implementation of IProjectNotificationEmailSender for development and testing. Logs email content to the console and optionally saves it to a local file. Used only when BUILVERO_ENV=local.
public sealed class LocalProjectNotificationEmailSender : IProjectNotificationEmailSender
- Inheritance
-
LocalProjectNotificationEmailSender
- Implements
- Inherited Members
Constructors
LocalProjectNotificationEmailSender(ILogger<LocalProjectNotificationEmailSender>, string?)
Initializes a new instance of the LocalProjectNotificationEmailSender class.
public LocalProjectNotificationEmailSender(ILogger<LocalProjectNotificationEmailSender> logger, string? emailOutputPath = "/tmp/emails")
Parameters
loggerILogger<LocalProjectNotificationEmailSender>The logger instance.
emailOutputPathstringOptional path to save email payloads. If null, emails are only logged.
Methods
SendProjectInvitationAcceptedAsync(ProjectInvitation, Project, User, User, CancellationToken)
Sends an email notification when a project invitation is accepted.
public Task SendProjectInvitationAcceptedAsync(ProjectInvitation invitation, Project project, User inviter, User invitee, CancellationToken cancellationToken = default)
Parameters
invitationProjectInvitationThe project invitation entity that was accepted.
projectProjectThe project the user joined.
inviterUserThe user who sent the invitation.
inviteeUserThe user who accepted the invitation.
cancellationTokenCancellationTokenCancellation token to cancel the operation.
Returns
- Task
A task representing the asynchronous operation.
Remarks
The email is sent to the inviter to notify them that their invitation was accepted.
SendProjectInvitationAsync(ProjectInvitation, Project, User, User, string, string, CancellationToken)
Sends an email notification when a project invitation is created.
public Task SendProjectInvitationAsync(ProjectInvitation invitation, Project project, User inviter, User invitee, string acceptUrl, string declineUrl, CancellationToken cancellationToken = default)
Parameters
invitationProjectInvitationThe project invitation entity.
projectProjectThe project the user is being invited to.
inviterUserThe user who sent the invitation.
inviteeUserThe user being invited.
acceptUrlstringThe secure URL for accepting the invitation (includes token).
declineUrlstringThe secure URL for declining the invitation (includes token).
cancellationTokenCancellationTokenCancellation token to cancel the operation.
Returns
- Task
A task representing the asynchronous operation.
Remarks
The email includes project information, inviter details, and action links for accepting or declining the invitation.
SendProjectInvitationDeclinedAsync(ProjectInvitation, Project, User, User, string?, CancellationToken)
Sends an email notification when a project invitation is declined.
public Task SendProjectInvitationDeclinedAsync(ProjectInvitation invitation, Project project, User inviter, User invitee, string? reason, CancellationToken cancellationToken = default)
Parameters
invitationProjectInvitationThe project invitation entity that was declined.
projectProjectThe project the user declined to join.
inviterUserThe user who sent the invitation.
inviteeUserThe user who declined the invitation.
reasonstringOptional reason provided by the invitee for declining.
cancellationTokenCancellationTokenCancellation token to cancel the operation.
Returns
- Task
A task representing the asynchronous operation.
Remarks
The email is sent to the inviter to notify them that their invitation was declined, including the reason if provided.
SendProjectJoinApprovedAsync(ProjectJoinRequest, Project, User, User, CancellationToken)
Sends an email notification when a project join request is approved.
public Task SendProjectJoinApprovedAsync(ProjectJoinRequest request, Project project, User requester, User owner, CancellationToken cancellationToken = default)
Parameters
requestProjectJoinRequestThe project join request entity that was approved.
projectProjectThe project the user joined.
requesterUserThe user whose join request was approved.
ownerUserThe project owner who approved the request.
cancellationTokenCancellationTokenCancellation token to cancel the operation.
Returns
- Task
A task representing the asynchronous operation.
Remarks
The email is sent to the requester to notify them that their join request was approved and they are now a project member.
SendProjectJoinDeclinedAsync(ProjectJoinRequest, Project, User, User, string?, CancellationToken)
Sends an email notification when a project join request is declined.
public Task SendProjectJoinDeclinedAsync(ProjectJoinRequest request, Project project, User requester, User owner, string? reason, CancellationToken cancellationToken = default)
Parameters
requestProjectJoinRequestThe project join request entity that was declined.
projectProjectThe project the user's join request was declined for.
requesterUserThe user whose join request was declined.
ownerUserThe project owner who declined the request.
reasonstringOptional reason provided by the owner for declining.
cancellationTokenCancellationTokenCancellation token to cancel the operation.
Returns
- Task
A task representing the asynchronous operation.
Remarks
The email is sent to the requester to notify them that their join request was declined, including the reason if provided.
SendProjectJoinRequestAsync(ProjectJoinRequest, Project, User, User, string, string, CancellationToken)
Sends an email notification when a project join request is created.
public Task SendProjectJoinRequestAsync(ProjectJoinRequest request, Project project, User requester, User owner, string approveUrl, string declineUrl, CancellationToken cancellationToken = default)
Parameters
requestProjectJoinRequestThe project join request entity.
projectProjectThe project the user wants to join.
requesterUserThe user who created the join request.
ownerUserThe project owner who can approve or decline the request.
approveUrlstringThe secure URL for approving the join request (includes token).
declineUrlstringThe secure URL for declining the join request (includes token).
cancellationTokenCancellationTokenCancellation token to cancel the operation.
Returns
- Task
A task representing the asynchronous operation.
Remarks
The email is sent to the project owner and includes project information, requester details, and action links for approving or declining the join request.