How to get notified by mail when rows are inserted into table? - mysql

I made an online store coded in JSP and tables stored in MysQl. I'm using servlet and classes. I would like to get notify by mail at admin#domain.com when an order is inserted in the database.
Likewise, the customer should receive the order confirmation to the email they entered when they submit the form.
I would like to get feedback on how to do such a task. What's the best practice? I hope to not get back fire with this question because I`m aware there are several answers possible.
Basically, I`m just looking for the easiest and fastest implementation without too much hassle!
The form contains very sensitive and confidential data like address and such. But, since our customers can track their orders on the site, the data should not be sent, for security purposes. Just a message to confirm the reception of their order.
Please guide me in the right direction.

If you are using Hibernate i would recommend you using an entity listener, specially with a #PostPersist callback. You can read about it in Chapter 6. Entity listeners and Callback methods.
The email part can be done using the JavaMail API.
You can check an example of sending an email in Sending an Email using the JavaMail API.
Hope it helps!

Related

Docusign - using two different email body/blurb contents

Hello I have setup our app using the dev/demo account and almost ready to get a paid account. I want to get a starter API account, which doesn't have Branding.
Can I remove the Resource File from the email body without having access to branding? Any other way?
I would like to setup one email body/blurb for the signing email and a different for the completed email. Again without branding would I be able to do that?
I have been able to add customize/add html into the signing email body but would like to add a new condition somehow for the completed
something like envDef.EmailBlurbCompleted =
thank you
There's only one emailBlurb field in DocuSign right now. That field is used in both the original as well as the final email that are sent out. You can customize it per recipient, which is not exactly what you're asking for.
You can change it after the envelope is created, but only if it's still in draft status.
Changing this field when an envelope is in sent status requires a correct operation. Which is also not exactly what you are asking to do.
At the moment what you're asking is not a feature that exist, you can build something to mimic this, but I'm not sure that is a good idea either.

"Send" code within a Send Message template

For many I'm sure, this is an easy fix but I've tried looking into it and to be quite honest, my knowledge of coding isn't like many of you. Having said that, I've downloaded a free template and I've been able to clean things up, make it my own except for one thing. When folks want to reach me, they add their name, number, email and message in the proper fields but when they hit "Send", I want their message and info to be sent to my email address. Can you please explain how this is done? I've attached the link so you can view.
http://landonmusicgroup.com/web3/contact.html#
Many thanks!
CL
As far as i understand, first u should note that sending email needs backend management, so first you should grap all form data, then should submit a form, and finally in backend u should check submitted data and execute sending email process

PDF to MS Access

I am attempting to implement the following for my school's website:
School registration is currently a hard-copy form.
They'd like applicants to fill out a PDF form online.
They then print, sign and mail it to the school.
The school want to be able to store the data entered by the applicant in the PDF so that when the signed application arrives, they can simply approve the registration for that student without reentering all the students info.
The school system is run on MS Access (if it matters which version I can find this out).
Any ideas how I can implement an import from their form to MS Access?
Thanks.
I've used a website called www.doculicious.com that does pretty much this exact thing. You can upload a PDF and have it converted into a web form. Whoever fills in the web form can download the completed PDF and print it out for signing. All the data is stored in the system and you can get it out as XML or CSV for importing into another database manually, or use the API to do that part automatically.
It depends on how automatically you want it to be. A fully automated case would be
Scan in the printed form using TWAIN
Use a Form Recognition library to align the form back to the original and find the zones with the information you want
Use OCR to get the information out of the form (probably ICR, if handwritten)
Find the original record in Access
Update the record with the new data
This isn't simple -- there are products out there that could help, but they are not cheap, and ICR is not very accurate.
I would suggest that you just do #4 and #5 in Access and give them a screen where they process an incoming form -- someone keys in the new data. That form
Lets you specify the record you want to update (like with a name or ssn)
Shows you the record with edit boxes for you to fill in with the form data
Saves it back when you are done.
This is straight-forward in Access.
The school can use a regular HTML form on their website and ask parents to submit details online. Your server-side can save the submitted details to your database and generate a unique submission token/key/code back to the parent on the web page. When the parents come to the school and mention the key, print their details on paper and ask them to sign it. You file the paper and the data is already in your database.
If the intent is to import from an electronically submitted form, I have used Adobe LifeCycle Designer to accomplish this very thing. Basically you can create an XML output of the PDF form data using an email client of the end users choice and have the data from the XML file read from the inbox into the fields of your MS Access database. Of course this solution has some serious constraints on what applications are to be used, as well as what use cases are handled, for example this solution is in a controlled environment in which all users are required to email there requests, where possibly your requirements may need to handle mailed correspondence as well.
I would add to VSU's answer by suggesting the use of Google Forms for data entry.
You just need a free account, then use Docs to create a new Form.
It's extremely easy to setup, and the submitted results en-up in a Google spreadsheet that you can download as an regular Excel file (that makes it very easy to import into Access).
You have a few ways to share the form:
Email a link to the form
Embed the form into an email
Embed the form in your web site, which is probably the best solution for you.
Once the data is in your database, you can easily create a report and a simple lookup form to find the name of the applicant and print the form.
It shouldn't take more than one hour to get start and have something functional.
You can always improve later once you've experimented with this.
The advantage of using Google forms is that it's free, it works well, and you are fairly secure since you're not linking your database directly to the Internet (and don't risk SQL injection).

Using email to update SQL database

Is it possible to use email to update mysql table?
for example I have someone send email which have today article with the image as an attachment and it have to send to particular email address (eg: abc#something.org) to be able to process data to sql table, other address will not work for updating.
Once it receive, it automatically proceed and update sql from the article it receive.
How is it work?
is there any open source that may help this process
Not by sql, you have to involve some sort of programming language which have a subset of methods to communicate with the database and that can receive and send email.
Take a look at Sendgrid (at http://sendgrid.com): they have a parse API (see http://wiki.sendgrid.com/doku.php?id=parse_api for details) that basically lets you convert an email into an HTTP POST. So if you already have a web page that can update the MySQL database you can just modify it to comply with their spec, set up a sub domain that forwards to Sendgrid and then setup a Sendgrid endpoint that takes any email to that sub domain and posts it to your web page.
It depends on your application. If you're using a framework like Wordpress, there are plenty of plugins available to integrate (e.g. Postie). If you have your own custom application, you may find an open source script to download the new messages, but you'll have to implement your own code to update your database.

send database info to email

I was wondering if sanyone could help me with the following:
I have some info inserted into mysql database on a couple of pages. After this is done I retrieve these info (in a new page) from the database and want to send them via email to various emails including one from the info from database.
I have built the email() function and "SELECT" all the info from the database (have them into some HIDDEN fields).
I am not sure how to go about getting these info sent via email.
I have tried, but all I get is an empty email with no info from database.
Hope I explained my problem and someone can give me clue about this.
Many thanks
Francesco
MySQL does not include a feature for sending email. So you'll need to write additional software to handle the job for you.
One issue to decide, how will the email be requested? -- How will the process be initiated?
You could have your web page (written in PHP or any other language), which shows the information on the screen also send the email. See sending email from php.
A better performing idea is to first queue up your requests for sending emails. That way you won't slow down your web server. Then have a background job process each of the requests, reading the database and sending off the emails. Google for "php background processing" for help or ask more questions on StackOverflow.
Also, remember to check that your email is not being treated as spam.
Re: using the data from the database for sending the email--that's easy, just read the database, then use the information for creating the email's to, cc, subject and other fields.