SendGrid with Jiwa  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

SendGrid with Jiwa  Topic is solved

Postby SBarnes » Mon Aug 10, 2020 10:08 am

Recently someone asked about the possibility of using SendGrid with Jiwa, attached is a copy of a plugin that will achieve this and works similar to the ones provided by Jiwa, all you need to do is provide the necessary API Key in the system settings.

The reason I ended up doing this is because I discovered an issue with trying to use the Outlook one inside a windows service such as the Rest API or the Scheduled Plugin Service even if the service is run as a given user in that it can't start Outlook, I am not sure if this is a one off problem to my machine or not.

Anyway the SendGrid one works with both, bear in mind that the normal security for approved senders under SendGrid still apply.
Attachments
Plugin Email - SendGrid.xml
SendGrid Plugin
(829.54 KiB) Downloaded 88 times
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1619
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: SendGrid with Jiwa

Postby Mike.Sheen » Mon Aug 10, 2020 2:12 pm

SBarnes wrote:I discovered an issue with trying to use the Outlook one inside a windows service such as the Rest API or the Scheduled Plugin Service even if the service is run as a given user in that it can't start Outlook, I am not sure if this is a one off problem to my machine or not.


You're not supposed to use the Outlook API from services - it *might* work, but it is unsupported.

For this reason we are adding the ability to specify per user which email mechanism to use - so services can use things like Sendgrid or the Microsoft Graph API, and other users can use Outlook. We've got a plugin which fills this need on this post.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: SendGrid with Jiwa

Postby SBarnes » Mon Aug 10, 2020 2:24 pm

If you are looking at this area the one thing I did notice with SendGrid because it only has async calls is Jiwa finishes the job of writing to the email call log before the call returns on some occasions which can be an issue if the call fails, I couldn't find a way to get around it that worked with Jiwa either not throwing other errors or SendGrid behaving properly and actually sending the email.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1619
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: SendGrid with Jiwa

Postby SBarnes » Thu Aug 27, 2020 10:09 am

Hi Mike,

attached is an upgraded version of multiple email providers plugin with SendGrid added that will also work with 7.2.1

When this functionality becomes standard will there be a way to register extra providers?
Attachments
Plugin Multiple Email Providers.xml
(862.62 KiB) Downloaded 85 times
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1619
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: SendGrid with Jiwa

Postby Mike.Sheen » Thu Aug 27, 2020 1:53 pm

SBarnes wrote:When this functionality becomes standard will there be a way to register extra providers?


Yes, a plugin will just need to have a class implementing the IEmailProvider interface, and in the ApplicationManager plugin add the provider to the list of the registered providers - exactly like in the provided sample.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: SendGrid with Jiwa

Postby SBarnes » Thu Aug 27, 2020 1:56 pm

Hi Mike,

I fudged letting the Application plugin to save the manager in a static variable to use for looking up settings given the instance is gone, would it be possible for IEmailProvider to have a manager property that gets hooked up?
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1619
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: SendGrid with Jiwa

Postby Mike.Sheen » Wed Jul 27, 2022 5:16 pm

Updated plugin to be safe to use with REST API enabled.

This fixes an issue where an error "Add failed. Duplicate key value supplied." would be reported when authenticating via the REST API with this Multiple Email Providers plugin enabled also.
Attachments
Plugin Multiple Email Providers 7.2.1.1.xml
(863.94 KiB) Downloaded 63 times
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: SendGrid with Jiwa

Postby DannyC » Wed Aug 03, 2022 6:55 pm

I've found an error with the 7.2.1.1 plugin version to deal with the REST API.

I wondered why SMTP would no longer authenticate to the SMTP mail server.

Much testing & I discovered that the
Code: Select all
decryptedSMTPPassword = encryptionObject.DecryptString(Manager.Staff.SMTPPassword, Manager.Database.FormatDateTime(Manager.Staff.SMTPPasswordLastChangedDateTime, true));

is returning a string "ERROR". So the SMTP server thinks that the password is ERROR.
This is about line 425?

Anyway I have added in a
Code: Select all
decryptedSMTPPassword = "myProperPassword"

just under so that I know it's getting the correct p/w.
Last edited by DannyC on Wed Aug 03, 2022 7:10 pm, edited 1 time in total.
User avatar
DannyC
Senpai
Senpai
 
Posts: 636
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 30

Re: SendGrid with Jiwa

Postby Mike.Sheen » Wed Aug 03, 2022 6:59 pm

If you just change / set the SMTP password password for that staff member and save it, does this resolve the issue?

If it does then something set either the SMTPPasswordLastChangedDateTime or the SMTPPassword via a direct table update, which would explain the "ERROR" coming back from DecryptString.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: SendGrid with Jiwa

Postby DannyC » Wed Aug 03, 2022 7:35 pm

If you just change / set the SMTP password password for that staff member and save it, does this resolve the issue?


Nope. Reset the SMTP password plenty of times thinking that it was wrong.
User avatar
DannyC
Senpai
Senpai
 
Posts: 636
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 30

Next

Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 2 guests

cron