emails into Ebase
Moderators: Jon, Steve, Ian, Dave
-
- Ebase User
- Posts: 201
- Joined: Fri Dec 20, 2013 1:29 pm
- Location: Dartford Borough Council
- Contact:
emails into Ebase
Is it possible for you to configure Ebase to recieve emails that you can then process via a script/form?
0 x
-
- Ebase User
- Posts: 82
- Joined: Fri Jan 15, 2016 2:34 pm
Re: emails into Ebase
I sort of did this indirectly. I created a Java class that would fetch emails from a mailbox, parse them, and return whatever data my Ebase script would need. I created an Ebase form with a Before Form script that used this class and processed its return data, and a scheduled task to call that form once a day.
0 x
-
- Ebase Staff
- Posts: 26
- Joined: Wed Oct 10, 2007 9:40 am
- Location: Ebase HQ
- Contact:
Re: emails into Ebase
I also have created a system to read emails into Ebase.
Rather than creating a Java class to do this I created the Java directly into my JavaScript.
I attached this script to the before form event of a form and then execute this form as a schedule executing every 30 seconds.
The parsed data is then written to a database table which in turn gets loaded into a form to display the emails.
I did it this way because my customer wanted to see a list of all the subject lines which when clicked showed the body of the email.
Also they wanted to know when an email had been read.
I have two versions of the script, one communicating with a pop3 email server and the other communicating with an exchange server.
Ian
Rather than creating a Java class to do this I created the Java directly into my JavaScript.
I attached this script to the before form event of a form and then execute this form as a schedule executing every 30 seconds.
The parsed data is then written to a database table which in turn gets loaded into a form to display the emails.
I did it this way because my customer wanted to see a list of all the subject lines which when clicked showed the body of the email.
Also they wanted to know when an email had been read.
I have two versions of the script, one communicating with a pop3 email server and the other communicating with an exchange server.
Ian
0 x
-
- Ebase User
- Posts: 201
- Joined: Fri Dec 20, 2013 1:29 pm
- Location: Dartford Borough Council
- Contact:
Re: emails into Ebase
Hi Ian,
I don't supose the Exchange version of your code is available to share?
Many thanks
Neil
I don't supose the Exchange version of your code is available to share?
Many thanks
Neil
0 x
-
- Ebase Staff
- Posts: 26
- Joined: Wed Oct 10, 2007 9:40 am
- Location: Ebase HQ
- Contact:
Re: emails into Ebase
Hi Neil,
I have attached a zip (rar) file containing the following:
Ebase server-side JavaScript
- processImapsEmail
- globalForImaps
- functions
They contain the javascript used in my application.
The processImapsEmail is the script that is attached to the before form event of my scheduled form.
The globalForImaps file is attached to the shared functions section of my scheduled form
The functions file is attached to the shared functions section of my scheduled form.
jsoup ( a jar file) needs to go into WEB-INF\lib
.
I use the jar file (jsoup) to extract the html portion of the email (if present).
If you have any difficulties please contact me.
mobile: 07834 101753
Regards
Ian
I have attached a zip (rar) file containing the following:
Ebase server-side JavaScript
- processImapsEmail
- globalForImaps
- functions
They contain the javascript used in my application.
The processImapsEmail is the script that is attached to the before form event of my scheduled form.
The globalForImaps file is attached to the shared functions section of my scheduled form
The functions file is attached to the shared functions section of my scheduled form.
jsoup ( a jar file) needs to go into WEB-INF\lib
.
I use the jar file (jsoup) to extract the html portion of the email (if present).
If you have any difficulties please contact me.
mobile: 07834 101753
Regards
Ian
- Attachments
-
- ebase_email.rar
- (358.07 KiB) Downloaded 278 times
0 x
-
- Ebase User
- Posts: 201
- Joined: Fri Dec 20, 2013 1:29 pm
- Location: Dartford Borough Council
- Contact:
-
- Ebase Staff
- Posts: 26
- Joined: Wed Oct 10, 2007 9:40 am
- Location: Ebase HQ
- Contact:
Re: emails into Ebase
Hi Neal,
Just one thing - you will need to comment out the call to workflow in the "processImapsEmail" file.
Also you will see in this file (just after the workflow section) the following:
// move the message to the processed folder and
// then delete it form the receiving folder
var msgArray = [];
msgArray.push(message);
received.copyMessages(msgArray, processed);
message.setFlag(Flags.Flag.DELETED, true);
This section moves the email out of the receiving mail box (in my case POC) and into one of the sub folders.
Ian
Just one thing - you will need to comment out the call to workflow in the "processImapsEmail" file.
Also you will see in this file (just after the workflow section) the following:
// move the message to the processed folder and
// then delete it form the receiving folder
var msgArray = [];
msgArray.push(message);
received.copyMessages(msgArray, processed);
message.setFlag(Flags.Flag.DELETED, true);
This section moves the email out of the receiving mail box (in my case POC) and into one of the sub folders.
Ian
0 x
Who is online
Users browsing this forum: No registered users and 3 guests