Welcome to the nuBuilder forums!

Please register and login to view forums and other content only available to registered users.

how to know if emailIt() has worked?

Locked
FBC-Tim
Posts: 25
Joined: Thu Jun 23, 2011 6:08 am

how to know if emailIt() has worked?

Unread post by FBC-Tim »

I am using an Extra Action Button to email a report directly by calling emailIt(). I need to save a note record to my database when this email has been sent, as a record of what the user has done.
If the user presses 'cancel' in the email dialog box, or if nuBuilder detects an email error I would like to skip creation of the note record.
I have tried the code below:

Code: Select all

  var scSuccess = emailIt('RPT-ServicePlan', scTo, scFrom, scSubject, scMessage, scFileName, false, 'PDF');

  if (scSuccess) {
    nuDebug('yyyyyyyyyyyyyyyyyyyyyyyyyyy');
  }
  else {
    nuDebug('nnnnnnnnnnnnnnnnnnnnnnnnnnn');
  }
But this code shows the 'nnnnnn' debug even before the user has pressed SEND. Javascript does not wait for emailIt() to complete.
If I understand correctly to only way to make JavaScript do this is for emailIt() to include a callback function? Is that right?

How is it possible to take action if the email was processed correctly? What do you suggest I do here?
admin
Site Admin
Posts: 2781
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 1 time

Re: how to know if emailIt() has worked?

Unread post by admin »

sotaabuts,

What are you talking about?
I don't understand what you are trying to say.
please read my entire post. .
What post?

Steven
zazzium
Posts: 84
Joined: Mon Jul 04, 2011 12:52 am

Re: how to know if emailIt() has worked?

Unread post by zazzium »

I have the same problem.
..has anyone found a solution to this?
admin
Site Admin
Posts: 2781
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 1 time

Re: how to know if emailIt() has worked?

Unread post by admin »

zazzium,

nuBuilder isn't the email program.

PHP sends it to whatever mail server you have on your server.

It can't guarantee what the email server does with it.

Maybe bcc a copy of the email to yourself.

Steven
zazzium
Posts: 84
Joined: Mon Jul 04, 2011 12:52 am

Re: how to know if emailIt() has worked?

Unread post by zazzium »

nuBuilder isn't the email program
fair enough

guess u have to modify reportemail.php or reportpdfemail.php to get a mark to database
that pdf invoice is successfully sent by email.
admin
Site Admin
Posts: 2781
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 1 time

Re: how to know if emailIt() has worked?

Unread post by admin »

.
Locked