Solved

Script to email almost expired IFS password

  • 4 March 2022
  • 5 replies
  • 299 views

Userlevel 3
Badge +8

Good afternoon,

 

I created a PL/SQL script in order to send emails to IFS users who have there password expiring within 7 days.

Now what I dont know, is where in IFS can I save this code, to be able to run it daily?

Basically like a quick report we create a scheduled task, but in this case it’s a procedure to send emails, which would also have a scheduled task?

 

Related to this, is there a way to bypass the MAIL SENDER context type, which is set to PLAIN TEXT, and send only these emails with HTML code?

 

Thanks in advance,

Carlos Mendes

icon

Best answer by Sajith D 6 March 2022, 23:12

View original

This topic has been closed for comments

5 replies

Userlevel 7
Badge +21

Hi @carlosfmendes ,

You can use a combination of an event of type PL/SQL block and an existing scheduled task to do this. You write your piece of code to figure out the users who needs to be alerts in the code and then you “command_sys.mail” standard procedure to send the email out to those users. The trigger point for the event to fire would be the execution of the aforementioned scheduled task. You can use something like the Heavy cleanup job which usually runs once a a day and use the standard BACKGROUND_JOB_IS_PROCESSED event to capture the execution of the job to trigger your event action.

Cheers

Userlevel 3
Badge +8

@Sajith D , thank you very much for your help and suggestion!

I ended up doing what you said, only changing the background job that launches the event, as Heavy Cleanup runs 3 times a day in our case, so I ended up using a background job we created for a quick report, that runs daily.

 

Just a question, will this action be a problem when we get updates or deliveries, considering it runs on a standard event, and not a custom event?

Could it be deleted upon updates?

Userlevel 7
Badge +21

Hi @carlosfmendes ,

Good to hear that you got it working the way you wanted it to. 

it’s quite unlikely that you would face any issues with an update or a patch. The standard BACKGROUND_JOB_IS_PROCESSED event has been there forever through multiple major versions and i don’t see that going away any time time soon.

Cheers

Userlevel 3
Badge +8

@Sajith D , I’m not worried about the event, but with the “custom” actions” I will associate with the event over time.

However, like you say, I don’t see any problems, however I keep a copy of all code, so no problem.

 

Thanks for your help!

Cheers

Userlevel 4
Badge +8

Good afternoon,

 

I created a PL/SQL script in order to send emails to IFS users who have there password expiring within 7 days.

Now what I dont know, is where in IFS can I save this code, to be able to run it daily?

Basically like a quick report we create a scheduled task, but in this case it’s a procedure to send emails, which would also have a scheduled task?

 

Related to this, is there a way to bypass the MAIL SENDER context type, which is set to PLAIN TEXT, and send only these emails with HTML code?

 

Thanks in advance,

Carlos Mendes

 

Hi Carlos,

We are also try to set up a daily job to notify end users to change the password on time. Could you please share your scripts? Thank you!

BR, 
William