1 2 Previous Next 16 Replies Latest reply on Jan 21, 2016 12:35 PM by vinvivek

    Reminder function for users?

    SusanJS Specialist

      Has anyone implemented some sort of a reminder function that can be used by end users?  I have a request to have users be able to set a date/time within a ticket (in our case, Incident) and when that date/time arrives, the system sends a reminder email to the owner.  I've setup the date/time field with the idea that when the field is filled in, it would trigger a workflow to send out the email.  I've gotten as far as the workflow, but am running into issues with the trigger.  I would like the workflow to trigger when the designated field is not empty, but with date/time fields, it only gives me the option of "grater than" or "less than".  I tried using the "Grater than $(Now())" statement, but I'm not sure if the Now() function is supported as it didn't seem to work. 

        • 1. Re: Reminder function for users?
          chris1 Apprentice

          Great idea.

          Not sure how you have it set up, I imagine you want it to start when someone adds a future reminder? If so How about something like this:

           

          ReminderDateTime Greater than $(AddSeconds(-1))

           

          Theoretically, this would cause it to attach the workflow if the field has a value greater than 1 second ago which would be NOW or greater.

          • 2. Re: Reminder function for users?
            SusanJS Specialist

            I don't think DateTime fields like functions in workflow.  This is what I had, but the workflow never triggered.  I tried setting it 15 minutes into the future and also several days into the future.  Nothing.

            DateTimeWorkflowConfig.png

            • 3. Re: Reminder function for users?
              chris1 Apprentice

              Crap, you're right. I always forget that limitation with workflow. In any case, I am thinking about building something similar.

               

              I like your idea a lot, but I thought I would extend it a little bit. It seems that multiple people might want a notification on the same item and it also seemed that users may want to remind on more than one object type. Here is what I am thinking:

              Create a new BO titled reminders or something similar.

              Include fields for the users email address, reminder text, parent number, parent recid, parent category (Incident, ServiceReq...), reminder date.

              Create relationships to the already existing BO's that users may want to have reminders sent for.

              Add a child panel (tab) for related reminders. This can filter to only show each users reminders or all of them. Only allow editing of your own reminders.

              Create a workflow against the reminders form that will fire for each and every item added to the form to run a workflow that just waits for the reminder time to send the notification.

              • 4. Re: Reminder function for users?
                chris1 Apprentice

                I created what I listed above. If anyone is interested I am willing to share it all. I have submitted it to the app store and I am hoping it wont take too long to approve.

                • 5. Re: Reminder function for users?
                  SusanJS Specialist

                  Wow!  You're fast! 

                  • 6. Re: Reminder function for users?
                    SusanJS Specialist

                    Support reminded me that I can trigger a workflow from a business rule!  So, here's another way to tackle this issue if you just want to trigger a workflow based on a single DateTime field:

                    1. Create your DateTime field and added it to your form(s).
                    2. Create your workflow to fire an email or whatever action you want it to do.
                    3. Create a business rule (Triggered Actions) to execute a workflow on initialize or update of the DateTime field you just added.

                    I do like chris1's Reminder idea though.  Pretty slick!

                    • 7. Re: Reminder function for users?
                      chris1 Apprentice

                      Susan,

                      Based on your ideas here and our discussion I created the reminder app above. It was just made available in the APP Store today. Feel free to go ahead and grab it if you like.

                      Go https://support.heatsoftware.com and go to the App Store after logging in.

                      • 8. Re: Reminder function for users?
                        florian1 Expert

                        Since most people here are getting too many E-Mails I'm sending out Outlook appointments (with reminders) instead:

                         

                        1) Create a reminder BO almost the same way as Chris did

                        2) Use "Run Program" to export this into a file + set the Incident to "Follow-Up"

                        3) Use Powershell to

                            a) predefine values according to the VCAL format, e.g.

                        # VCAL in ICS format

                        $emailBody =

                        "BEGIN:VCALENDAR

                        VERSION:2.0

                        PRODID:-//YOUR COMPANY//HEAT ICS//DE

                        METHOD:REQUEST

                        BEGIN:VEVENT

                        [...]

                             b) create this as an Attachment InMemory..

                             c) ..and finally send it to the EndUser

                        4) Reactivate the Incident after waiting for the date.

                         

                        This is working fine so far - but I'd love to hear of other approaches to achieve an Outlook reminder.

                        1 of 1 people found this helpful
                        • 9. Re: Reminder function for users?
                          chris1 Apprentice

                          Great idea.

                          Would you be willing to share your powershell script?

                          • 10. Re: Reminder function for users?
                            holger.weeres@heatsoftware.com Apprentice

                            Yes, thanks to Chris, everyone can now download his App for free and simply  import this functionality via dev-package into staging to test it out. I tested it myself and it worked like a charm.  I hope we will see many more customers that liked to share functionality with others in the community via the new AppStore. If you are interested, please contact me directly and I will work with you to make it happen.

                            • 11. Re: Reminder function for users?
                              florian1 Expert

                              Hi Chris,

                               

                              it basically looks like this:

                               

                              #####################################################################

                              # SendOutlookReminder.ps1

                              #

                              #      Author: Florian Deutsch

                              #        Year: 2016

                              # Description: Send an Outlook reminder by provided parameters

                              # --> Example: .\SendOutlookReminder.ps1 -OrganizerEmail "[email protected]" -AttendeeEmail "[email protected]" -StartTime "2016-02-01 10:00" -Summary "Your summary" -Description "Desc\nNextLine"

                              #

                              #####################################################################

                              param (

                                  # organizer (DefaultFromAddress)

                                  [Parameter(mandatory=$true)]

                                  [string]$OrganizerEmail,

                               

                                  # attendee, e.g. "[email protected]"

                                  [Parameter(mandatory=$true)]

                                 [string]$AttendeeEmail,

                               

                                  [Parameter(mandatory=$true)]

                                  [datetime]$StartTime,

                                  [datetime]$EndTime = $StartTime.AddMinutes(15),

                                 

                                  [Parameter(mandatory=$true)]

                                  [string]$Summary,

                               

                                  [Parameter(mandatory=$true)]

                                  [string]$Description,

                               

                                  [int]$Priority = 1,

                               

                                  # remind x minutes before

                                  [string]$Trigger = "60M",

                               

                                  # attach the appointment instead of directly sending it

                                  [switch]$SendAsAttachment

                                   )

                               

                              function Validate-Date ($Date)

                              {

                                  $result= 0

                                  [bool]$isValid = $false

                               

                                  if (!([DateTime]::TryParse($Date, [ref]$result)))

                                  {

                                      $isValid= $false

                                  }

                                  else

                                  {

                                      [datetime]$dtDate = $date

                                      [datetime]$Past = (Get-Date).AddHours(-8)

                                      [datetime]$Future = (Get-Date).AddYears(3)

                               

                                      if($dtDate -ge $Past -and $dtDate-le $Future)

                                      {

                                          $isValid = $true

                                      }

                                      else

                                      {

                                          $isValid = $false

                                      }

                                  }

                                  return $isValid

                              }

                               

                              function Validate-Email ([string]$mail)

                              {

                                return $mail -match "^(?("")("".+?""@)|(([0-9a-zA-Z]((\.(?!\.))|[-!#\$%&'\*\+/=\?\^`\{\}\|~\w])*)(?<=[0-9a-zA-Z])@))(?(\[)(\[(\d{1,3}\.){3}\d{1,3}\])|(([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,6}))$"

                              }

                               

                              ### Validation ###

                              # validate Start-/EndDate

                              if (!(Validate-Date($StartTime)) -Or !(Validate-Date($EndTime)))

                              {

                                  Throw "Failed while validating End-/StartDate."

                              }

                              # validate E-Mail

                              if (!(Validate-Email($OrganizerEmail)) -Or !(Validate-Email($AttendeeEmail)))

                              {

                                  Throw "Failed while validating email addresses."

                              }

                               

                              ### 1. Generate iCalendar (*.ics) as per RFC 5545 ###

                              $reminderStart = $StartTime.ToUniversalTime() | get-date -UFormat %Y%m%dT%H%M%SZ

                              if(!($EndTime))

                              {$EndTime = $StartTime.AddHours(1)}

                              $reminderEnd = $EndTime.ToUniversalTime() | get-date -UFormat %Y%m%dT%H%M%SZ

                              $reminderTimestamp = (Get-Date).ToUniversalTime()| get-date -UFormat %Y%m%dT%H%M%SZ

                              $UID = $(Get-Date -Format "yyyyMMddHHmmssf")

                              $method = $(if(!($SendAsAttachment)){"REQUEST"}else{"PUBLISH"})

                               

                              $ics =

                              "BEGIN:VCALENDAR

                              VERSION:2.0

                              PRODID:http://www.your-company.com

                              METHOD:$($method)

                              BEGIN:VEVENT

                              UID:$($UID)"

                              if(!($SendAsAttachment))

                                  {

                                  $ics+= "

                                  ORGANIZER:MAILTO:$($OrganizerEmail)

                                  ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE:MAILTO:$($AttendeeEmail)"

                                  }

                              $ics+="

                              DTSTAMP:$($reminderTimestamp)

                              DTSTART:$($reminderStart)

                              DTEND:$($reminderEnd)

                              SUMMARY:$($Summary)

                              DESCRIPTION:$($Description)

                              STATUS:TENTATIVE

                              CLASS:PUBLIC

                              TRANSP:OPAQUE

                              CREATED:$($reminderTimestamp)

                              PRIORITY:$($Priority)

                              SEQUENCE:0

                              BEGIN:VALARM

                              TRIGGER:-PT$($Trigger)

                              ACTION:DISPLAY

                              DESCRIPTION:$($Description)

                              END:VALARM

                              END:VEVENT

                              END:VCALENDAR"

                               

                              ### Generate the mail parts ###

                              # 1. attachment

                              $attachName = "Reminder_$(Get-Date -Format "yyyyMMddHHmm")"

                              $enc = [system.Text.Encoding]::UTF8

                              $data = $enc.GetBytes($ics)

                              $Stream = New-Object System.IO.MemoryStream (,$data)

                              $mailAttach = New-Object Net.Mail.Attachment([IO.Stream]$stream,"$($attachName).ics","text/calendar")

                              $mailAttach.TransferEncoding = [System.Net.Mime.TransferEncoding]::Base64

                              $mailAttach.ContentType.CharSet = "utf-8"

                              $mailAttach.ContentType.Parameters.Add([string] "method", [string] "$($method)")

                              # send the calendarItemdirectly

                              if (!($SendAsAttachment)){

                                  $mailAttach.ContentDisposition.Inline = $true

                                  $mailAttach.ContentDisposition.DispositionType = "inline"

                              }

                               

                              # 2. message

                              $mailMessage = New-Object System.Net.Mail.MailMessage

                              $mailMessage.From = $($OrganizerEmail)

                              $mailMessage.To.Add($AttendeeEmail)

                              $mailMessage.Subject = $($Summary).ToString()

                              $mailMessage.Attachments.Add($mailAttach)

                              $mailMessage.IsBodyHtml = $false

                              $mailMessage.Headers.Add("Content-Type","text/calendar; method=$($method);")

                               

                              if ($SendAsAttachment){

                                  $mailMessage.Body = $($Description).Replace("\n","`r`n")

                              }

                               

                              ### Send Email ###

                              $smtpServer = "smtphost.fqdn"

                              $smtpPort = 25

                               

                              $smtp = New-Object System.Net.Mail.SmtpClient($SMTPServer, $SMTPPort);

                              $smtp.EnableSSL = $false

                              #$smtp.Credentials = New-Object System.Net.NetworkCredential($Username, $Password);

                               

                              Try

                              {

                                  $smtp.send($mailMessage)

                              }

                              Catch {

                                  Throw "Failure while sending the mail: " + $_.Exception.Message

                              }

                               

                              return [string]::Format("Reminder sent to [{0}].", $AttendeeEmail)

                               

                              • 12. Re: Reminder function for users?
                                aviera Rookie

                                Cheers! I've been wanting to implement this into our new Heat software, currently in its 2nd/3rd week of being live. At my last workplace we used another system and had a status of Scheduled-Remote. A status of Scheduled remote would let the SD Manager know that communication has taken place between the engineer and the client and they have agreed to work on the issue a few days from now, the engineer would then schedule the appt to work with the user for a future date and a reminder, this would be tied to their outlook and create the reminder. Florian or Chris - Has this idea been placed somewhere where we can easily import it into our test system to test? That would be a great help!!

                                • 13. Re: Reminder function for users?
                                  chris1 Apprentice

                                  I have created a Reminders App that is in the App Store on the HEAT Support site (support.heatsoftware.com).

                                  The version on the app store doesn't have the creation of outlook items. It can be easily exported into your test environment. You will have some additional development to add it into some forms in your system.

                                  • 14. Re: Reminder function for users?
                                    chris1 Apprentice

                                    Awesome, Thanks Florian!

                                    1 2 Previous Next