Skip to content

Commit 7490d32

Browse files
committed
Mail: Configure new settings within HAC
1 parent bb007b6 commit 7490d32

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

modConverse.vb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ Module modConverse
102102
strCommandResponse = "Local queue mode disabled"
103103
Case "mail"
104104
strCommandResponse = modMail.Disable()
105+
Case "mailchecks"
106+
strCommandResponse = modMail.DisableChecks()
105107
Case "mapquest"
106108
strCommandResponse = modMapQuest.Disable()
107109
Case "matrixlcd"
@@ -164,6 +166,8 @@ Module modConverse
164166
strCommandResponse = "Local queue mode enabled"
165167
Case "mail"
166168
strCommandResponse = modMail.Enable()
169+
Case "mailchecks"
170+
strCommandResponse = modMail.EnableChecks()
167171
Case "mapquest"
168172
strCommandResponse = modMapQuest.Enable()
169173
Case "matrixlcd"

modMail.vb

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,13 +193,27 @@ Module modMail
193193
Return "Mail module disabled"
194194
End Function
195195

196+
Function DisableChecks() As String
197+
Unload()
198+
modDatabase.AddOrUpdateConfig("Mail_ScheduledChecks", "disabled")
199+
Load()
200+
Return "Scheduled mail checks disabled"
201+
End Function
202+
196203
Function Enable() As String
197204
My.Settings.Mail_Enable = True
198205
My.Application.Log.WriteEntry("Mail module is enabled")
199206
Load()
200207
Return "Mail module enabled"
201208
End Function
202209

210+
Function EnableChecks() As String
211+
Unload()
212+
modDatabase.AddOrUpdateConfig("Mail_ScheduledChecks", "enabled")
213+
Load()
214+
Return "Scheduled mail checks enabled"
215+
End Function
216+
203217
''' <summary>
204218
''' This function returns the CmdKey of a CmdAllowlist email.
205219
''' </summary>
@@ -358,6 +372,13 @@ Module modMail
358372

359373
CreateMailkeysDb()
360374

375+
If My.Settings.Mail_SMTPHost = "smtp.purelymail.com" AndAlso modDatabase.GetConfig("Mail_PurelyMailAPIKey") = "" Then
376+
My.Application.Log.WriteEntry("SMTP is PurelyMail, but no API key set, asking for it")
377+
Dim strNewPurelyMailAPIKey As String = InputBox("Enter an API key for your PurelyMail account to monitor remaining funds", "PurelyMail API Key")
378+
If strNewPurelyMailAPIKey = "" Then strNewPurelyMailAPIKey = "(skipped)"
379+
modDatabase.AddOrUpdateConfig("Mail_PurelyMailAPIKey", strNewPurelyMailAPIKey)
380+
End If
381+
361382
oClient.Host = My.Settings.Mail_SMTPHost
362383
oClient.Port = My.Settings.Mail_SMTPPort
363384
If oClient.Port = 465 OrElse oClient.Port = 587 Then

0 commit comments

Comments
 (0)