Office365-Scoutnet-synk

Synkronisering av användarkonton och e-postlistor från Scoutnet till Office 365


Project maintained by Scouterna Hosted on GitHub Pages — Theme by mattgraham

Send-SNSMandatoryMomentReminder

Sends reminders to members who need to do or renew a mandatory moment.

Description

Sends one mail to each member who is older than MandatoryMomentMinimumAge, has at least one non-excluded role and has a moment (Trygga moten or Registerutdrag) that is missing or expires within MandatoryMomentReminderDaysBefore days. The mail goes to the member’s e-mail address in Scoutnet, with contact_alt_email as fallback, and to MandatoryMomentReminderCc as a copy. Members listed in MandatoryMomentCourseExemptMembers or MandatoryMomentPoliceCheckExemptMembers are not reminded about that moment.

Reminders are sent once per period, set by MandatoryMomentReminderFrequency. The texts and links in the mail are taken from the MandatoryMomentReminder* and Mandatory*ReminderText/Links settings. A failure for one member is logged as an error and does not stop the others.

Syntax

Send-SNSMandatoryMomentReminder [[-Configuration] <Object>] [[-Memberlist] <IDictionary>] [[-LastSentValue] <Object>] [[-AsOfDate] <datetime>] [[-TestEmailAddress] <string>] [[-FrequencyOverride] <string>] [<CommonParameters>]

Parameters

-Configuration

Type: Object; optional.

The configuration. Defaults to the current SNS configuration.

-Memberlist

Type: IDictionary; optional.

Optional Scoutnet member list. When omitted, it is fetched using the member list credential.

-LastSentValue

Type: Object; optional.

Raw value of the MandatoryMomentReminderLastSent Automation variable. An empty, missing or invalid value makes the reminders run regardless of the configured frequency.

-AsOfDate

Type: DateTime; optional.

Date used for frequency, ages and validity. Defaults to today.

-TestEmailAddress

Type: String; optional.

Test mode. All reminders are sent to this address instead of the members and MandatoryMomentReminderCc is not used.

-FrequencyOverride

Type: String; optional.

Examples

Example 1

$lastSent = Get-AutomationVariable -Name 'MandatoryMomentReminderLastSent'
if (Send-SNSMandatoryMomentReminder -Configuration $conf -LastSentValue $lastSent) {
    Set-AutomationVariable -Name 'MandatoryMomentReminderLastSent' -Value (Get-Date -Format 'o')
}