Expand my Community achievements bar.

Using submit by email - possible to auto email sender?

Avatar

Level 2

Is it possible when using a submit by email button to automatically email the sender a notification that the pdf was sent?  Any suggestions would be great, thank you.

Charley

14 Replies

Avatar

Level 10

Hi,

Paul has a PDF example of different email solutions (http://forums.adobe.com/message/2435643#2435643).

If you include a field for the sender to input their email address, then they will get a copy of the form as well.

?There is a way to look and see if the user has an email address, but it is considered to be a security risk and requires a trusted function. This can be troublesome, so see if you can come up with a general solution first.

That's all I can think of at this stage.

Good luck,

Niall

Avatar

Level 4

Hi Niall,

Are you aware of any way to populate a drop-down list without a database?  I.e., one selects US for Field1 and Field2 populates with US states  or  one selects a state in Field1 and Field2 populates with the cities of that state.  That type of thing.  Is there a way to hard-code that and not use a database?  Thanks.

Avatar

Level 10

Hi,

Here are two examples.

The first has the states set in the Object/Field tab and we are just hiding and showing the appropriate state depending on the country choice.

The second has only one state dropdown and this is set using addItem() method from the exit of the country dropdown.

Check out the exit event scripts.

I "think" the states are correct, but you would need to check.

Hope that helps,

Niall

Avatar

Level 4

It's approaching 2:00am and my brain is not at peak performance, and so I will take a look at your examples after some snooze.  Thank you very much.  You and Paul are truly Civil Rights leaders because you set novices like me FREE from early baldness and grey hair.

Avatar

Level 10

No problem,

After your shut eye, have a look at John Brinkman's second address sample here: http://blogs.adobe.com/formfeed/2008/12/canadianus_address_data_captur.html

It is more elegant when dealing with the differences between state/provence and when addItem for the display value and bound value.

Good luck,

Niall

Avatar

Level 2

Hi Niall,

Thanks a lot for your reply.  I had considered both of those; my campus is a little large to implement Trusted Function and I was just throwing it out there in hopes that there was a different automated solution.  I think having the user enter their email address will work perfectly fine.  Thanks again, i appreciate it.


Charley

Avatar

Level 2

Niall,

Wondering if you might be able to help out with something on adding the email field.  Here it goes: I have the script setup to send a Bcc to the sender, when I enter an email address in the field and click submit, the email will be addressed to a user in my company named MNull (i'm guessing because the code is returning a null value. Actually kinda comical that theres and "Null" in my company), the same happens if the field is left empty. If I enter an email address then leave the field, the email will go to the correct recipients.  This field is also optional for the user so if there is no value, its creates a little bit of a problem.  In Paul's example the same happens if the field is left empty.  So I guess what I'm asking: if there's a way to ignore the field if has a null value? and also if there's a way to get around having to leave the field for the script to tell there's something there?  Any help or ideas you have would be great.  Thank you.

Charley

Avatar

Level 10

Hi Charley,

We have a similar form and what I do is check that the field is not null before compiling the email addresses. The following is FormCalc and the check for rawValues is looking at checkboxes. If all of the checkboxes are "0" (off) then the email address list is blank. Otherwise I use a concat to form the email addresses.

if (nod.rawValue == 0 & cc1.rawValue == 0 & cc2.rawValue == 0) then

     $ = null

else

     $ = Concat(EM1_email, cc1_email, cc2_email, additional)

endif

There are three checkboxes for standard recipients. The "additional" is a free text textField where the user can input additional email addresses, separated by a semi-colon ;

If the email address field is null, it does not try and send an email; eg control the function before it goes to the email client.

Parallels Desktop1.png

In relation to the MNull (I have not come across a Null before ;-), I would use the full email address, which should not get read as "null".

In the above we combine all the email addresses into a single hidden textField and then assign that to the "to" property in the email message.

A similar apparoach should also work for you when you are assigning a bcc. First check for null values, then use the full address for MNull ;-)

Good luck,

Niall

Avatar

Level 4

METHOD 1 -  I moved the USstate field and couldn't find the CAstate field, but it's there.  Haha.  I didn't know about the  Hidden (Exclude from Layout) setting until now.  Haha.  That's a funny trick - layering one field atop another.

METHOD 2 - No Houdini tricks here.  The script was striaghtforward.  We'll see just how straight forward when I go to code my own.  Examples are always straightforward.

Actually,  Niall,  I asked this question not because I needed a US/CA - States/Provinces solution, but because I have something like:

Select        Submenu                     Sub-submenu

-------        ------------                     ----------------

A               Ai, Aii, Aiii,... Ax       If Ai is selected, the sub-submenu = Ai1, Ai2, Ai3,...

                                                      If Ax is selected, the sub-submenu = Ax1, Ax2, Ax3,...

B               Bi, Bii,... Bz

etc.

Understanding a submenu example like the US/CA - States/Provinces solution has been helpful.  I think I need more nesting than the US/States example - at least for METHOD 1, and I may be better off with the switch statement than IF..ELSE,  given my menu selections.  Off I go to figure this one on my own.

Thank you,  Niall.

Avatar

Level 10

Hi,

It looks like you are setting up three dropdowns (?).

If that is the case then it is still relatively straightforward. John Brinkman has some excellent examples for scripting dropdowns (search previous web link).

If you use addItem("some text"); then the rawValue of the dropdown will be "some text".

However if you include a bound value in the script, like addItem("some text", "Ai"); then the user will see "some text", but the rawValue will be "Ai".

This may make if easier for you to script the third dropdown. There is an example of accessing the display value and the raw value at: Re: is it possible to get the key/value of the dropdown?

John Brinkman advises that the correct place to populate a dropdown is in the preOpen event. So in the second dropdown the switch statement would go in the preOpen looking back at the rawValue of the first dropdown. Similarly the preOpen event of the third dropdown would look back at the rawValue of the second dropdown.

I would recommend using a switch statement.

Good luck,

Niall

Avatar

Level 4

>  It looks like you are setting up three dropdowns (?).

Four.   :-)

I will search Brinkman's blog for examples and visit the link you provided above after some snooze. .  Thank you.

Avatar

Level 7

Hi Niall, is it possible to post the complete sample of this form with the checkboxes and the free textField?

Thanks very much

Avatar

Level 10

Hi,

Here is a sample.

Please note that this was for a very specific purpose. Clicking the envelope button will bring up the comms window. Also I have it set in the docReady event that when the form is opened it will clear previous selections and inputted email addresses. You may want to change this.

In the comms subform there are hidden fields that compile the full email list. These are invisible but you should be able to follow the logic in the hierarchy window.

If you change the caption in the checkboxes and look at the script in the mouseUp events you can set your own standard email addresses. Also you may want better instructions for the users.

Lastly the email button is set to email the form back as a PDF. If the users have Reader and the form is not Reader Enabled the script may fail. You would have to change the submitAs to XML.

Hope that helps,

Niall

Avatar

Level 7

Excellent example!

Thanks Niell