Website openantrag.de
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
OpenAntrag/OpenAntragLib/Manager/MailManager.vb

69 lines
2.2 KiB

Imports ActionMailer.Net.Mvc
Public Module MailManager
Public Sub SendResetPasswordToUser(model As ResetPasswordModel)
If SettingsWrapper.SendMail = True Then
Try
If Not String.IsNullOrEmpty(model.MailAddress) Then
Dim mc As New MailController
Dim result As EmailResult = mc.ResetPassword(model)
result.Deliver()
End If
Catch ex As Exception
PushoverManager.SendError("SendResetPasswordToUser", ex)
End Try
End If
End Sub
Public Sub SendNewProposal(model As Proposal)
If SettingsWrapper.SendMail = True Then
Try
If Not String.IsNullOrEmpty(model.Representation.InfoMail) Then
Dim mc As New MailController
Dim result As EmailResult = mc.NewProposal(model)
result.Deliver()
End If
Catch ex As Exception
PushoverManager.SendError("SendNewProposal", ex)
End Try
End If
End Sub
Public Sub SendNewProposalComment(model As ProposalComment, prop As Proposal)
If SettingsWrapper.SendMail = True Then
Try
If Not String.IsNullOrEmpty(prop.Representation.InfoMail) Then
Dim mc As New MailController
Dim result As EmailResult = mc.NewProposalComment(model, prop)
result.Deliver()
End If
Catch ex As Exception
PushoverManager.SendError("SendNewProposalComment", ex)
End Try
End If
End Sub
Public Sub SendNewProposalAbuseNotice(model As ProposalAbuseNotice)
If SettingsWrapper.SendMail = True Then
Try
If Not String.IsNullOrEmpty(model.Proposal.Representation.InfoMail) Then
Dim mc As New MailController
Dim result As EmailResult = mc.NewProposalAbuseNotice(model)
result.Deliver()
End If
Catch ex As Exception
PushoverManager.SendError("SendNewProposalAbuseNotice", ex)
End Try
End If
End Sub
End Module