Checks the certificate on every domain in your sheet each morning and emails the ones running out of time to renew.

UsesGmailGoogle Sheets

Warn before SSL certificates expire

ScheduleRun every day at 08:00.Run every day at 08:00.
ValuesSet domainSheetUrl to blank.Set domainSheetUrl to blank.
ValuesSet domainSheetTab to blank.Set domainSheetTab to blank.
ValuesSet certificateApiUrl to blank.Set certificateApiUrl to blank.
ValuesSet alertEmail to blank.Set alertEmail to blank.
ValuesSet warnWithinDays to 30.Set warnWithinDays to 30.
Google SheetsGoogle SheetsRead the rows of domainSheetUrl. Save it as domainSheet.Read the rows of domainSheetUrl. Save it as domainSheet.
ValuesSet sites to domainSheet.rows.Set sites to domainSheet.rows.
ValuesSet expiringSoon to an empty list.Set expiringSoon to an empty list.
ValuesSet couldNotCheck to an empty list.Set couldNotCheck to an empty list.
Decisions & LoopsFor each site in sites:For each site in sites:
ValuesSet domain to blank.Set domain to blank.
Decisions & LoopsIf a step below fails, save the error as missingDomainIf a step below fails, save the error as missingDomain
Try
TextTrim site.Domain and save it as domain.Trim site.Domain and save it as domain.
On error
ValuesChange domain to blank.Change domain to blank.
Decisions & LoopsIf domain is emptyIf domain is empty
Yes
Decisions & LoopsSkip to the next item.Skip to the next item.
No
No steps
ValuesSet daysLeft to 0.Set daysLeft to 0.
ValuesSet expiresOn to blank.Set expiresOn to blank.
ValuesSet wasChecked to false.Set wasChecked to false.
Decisions & LoopsIf a step below fails, save the error as checkFailedIf a step below fails, save the error as checkFailed
Try
HTTPFetch certificateApiUrl plus domain and save it as certificate.Fetch certificateApiUrl plus domain and save it as certificate.
TextTrim certificate.body.result.valid_till and save it as expiryDate.Trim certificate.body.result.valid_till and save it as expiryDate.
Dates & TimesCount the days from today's date to expiryDate and save it as daysLeft.Count the days from today's date to expiryDate and save it as daysLeft.
ValuesChange expiresOn to expiryDate.Change expiresOn to expiryDate.
ValuesChange wasChecked to true.Change wasChecked to true.
On error
ListsAdd domain - checkFailed.message with certificateApiUrl replaced by the endpoint address to the end of couldNotCheck and save it as couldNotCheck.Add domain - checkFailed.message with certificateApiUrl replaced by the endpoint address to the end of couldNotCheck and save it as couldNotCheck.
Decisions & LoopsIf wasChecked is yes and daysLeft is less than or equal to warnWithinDaysIf wasChecked is yes and daysLeft is less than or equal to warnWithinDays
Yes
Decisions & LoopsIf daysLeft is less than 0If daysLeft is less than 0
Yes
ListsAdd domain - EXPIRED on expiresOn to the end of expiringSoon and save it as expiringSoon.Add domain - EXPIRED on expiresOn to the end of expiringSoon and save it as expiringSoon.
No
ListsAdd domain - expires on expiresOn (daysLeft days left) to the end of expiringSoon and save it as expiringSoon.Add domain - expires on expiresOn (daysLeft days left) to the end of expiringSoon and save it as expiringSoon.
No
No steps
ValuesSet report to blank.Set report to blank.
Decisions & LoopsIf expiringSoon isn't emptyIf expiringSoon isn't empty
Yes
ValuesChange report to Certificates expiring within warnWithinDays days:Change report to Certificates expiring within warnWithinDays days: expiringSoon joined by a new line .
No
No steps
Decisions & LoopsIf couldNotCheck isn't emptyIf couldNotCheck isn't empty
Yes
ValuesChange report to reportChange report to report These sites could not be checked: couldNotCheck joined by a new line .
No
No steps
Decisions & LoopsIf report is emptyIf report is empty
Yes
Decisions & LoopsFinish the run: Every certificate checked is valid for more than warnWithinDays more days.Finish the run: Every certificate checked is valid for more than warnWithinDays more days.
No
No steps
GmailGmailSend an email to alertEmail.Send an email to alertEmail. Subject: SSL certificate check: the length of expiringSoon expiring within warnWithinDays daysreport