Jump to content

This topic is 7243 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi All,

I've just converted our 80 file FM 6 system to a nice 11 file FM 7 system.

The only think holding me back in deploying the system is the few websites we had connected to FM for a few of our customers to log in an make a reservation or lookup properties they have in stock.

This was done with some CDML - and worked fine for us for a number of years.

My initial plan was to get these up with IWP and then learn how to use the new xml/xslt system with Advanced to make the equivalent of our CDML system.

I have found that for the simple things we need to do, IWP will be fine.

However, one - what I thought would be simple - thing is now holding me back....

Sending an email when an order is placed. We have it set up now that via the CDML pages, an email is generated to the user who ordered and to the person that will handle the order at the company.

I have searched around and have been trying to come up with something to what should be a simple thing with IWP - and I am completely stumped.

I have tried the SMTPit plugin which we own for sending emails via FM - this does not work. I've seen the web trigger script - but it is windows only. I've seen a few posts about using PHP - but no explanation on how this is accomplished.

Could someone who has a set up with IWP to send an email be so kind as to share their experience on what they have do to do this?

I'm eager to deploy my new system - and it is truly maddening that I cannot overcome this issue after the months of converting and testing my FM system.

Thank you very much for any help,

Jerremy

Posted

Hi Jerremy

You can do the following:

If IWP is served on a 5 client version use Dacroons Mailit - this works with IWP including sending attachments, if they are located on the same machine as FileMaker pro.

-

If IWP is served on a Server Advanced solution it is a bit more complicated to use Dacroons Mail It or SMTP it.

-but it works-

To setup 3 party plugins and make them work with IWP Server Advanced Solution do the following:

1: Assign / buy a dedicated "Email Computer" (a MiniMac will do fine).

2: Buy the Troi Activator. And install it on the MiniMac

3: Install a client version of filemaker on the MiniMac.

4: Download and install the DoThisNow software from: http://www.radicalbreeze.com/dothisnow/index.html

5: In your solution on the server advanced create a field >trigger< INDEXED tthat auto enters the number 2 and a INDEXED error field >trigger error< .

6: In your solution on the Server Advanced create 3 fields for the Troi Activator

a: Global [time] >next_time_trigger< field.-----used to set the next time the first script to run

b: Global [date] >next_date_trigger< field.-----used to set the next date to run

c: Global [text] >error_code< field.-----used to set the different inputs by the Troi Activator.

7: Create a new layout (let's call it >email<). with the new fields on and a start and a stop button

8: Create a new "email account" (let's call it >email<).

9: In your open script make new if statment = PatternCount ( Get ( PrivilegeSetName ) ; "Email" ) go to layout >email<

10: In your solution on Server Advanced create the following new scripts: (i write all scripts simple, you can include >Allow user abort< etc on your self)::

Script 1: [start trigger script] (to be assigned to the start button):

Set field >next_time_trigger< Get ( CurrentTime )

Set field >next_date_trigger< Get ( CurrentDate )

Preform script [schedule Next]

------

Script 2: [schedule Next] (used by Script 1 and script 5):

Set field >next_time_trigger< Get ( CurrentTime ) + "00:00:10" Get ( CurrentTime )

Set field >next_date_trigger< Get ( CurrentDate )

Preform script [schedule Delete All Events]

Preform script [schedule it]

------

Script 3: [schedule it] (used to activate Script 6):

Set field >error_code< External("Actr-ScheduleEvent"; "-addSingleEvent|" & GetAsNumber(email::next_date_trigger) & "|"& GetAsNumber(email::next_time_trigger) &

"|" & Get(FileName) & "|Send Trigger|1|1")

------

Script 4: [schedule Delete All Events] (used by Script 2):

Set field >error_code< External ( "Actr-DeleteEvent"; "-deleteAllEvents" )

------

Script 5: [schedule Delete All Events] (used by Script 2 and the stop button on the email layout):

Set field >error_code< External ( "Actr-DeleteEvent"; "-deleteAllEvents" )

------

Script 6: [send Trigger] (used by Script 3):

Preform find [Restore] -----find the number "1" in the field >trigger< and not "error" in the field >triggererror<

if Get ( FoundCount ) < 1

Preform script [schedule Next]

Exit script

else

Preform script [send]

The script [send] is your own script for sending email ! This [send] script should set the field >trigger< to 2 on error and the >triggererror< field to "error" on error.

In the button of the script send insert Preform script [schedule Next]

Create a script that set this field >trigger< to 1 when it is ok to send a email. (make sure all field is filled out:to/subject/body etc.

Then when your users submit this script it turns to the number 1.

------

11: Create a FileMaker file for the MiniMac (let's call it EmailTrigger.fp7) Assign the same "email account" username and password for the email account in the solution on Server Advanced.

(i use a extra script called [send Rapport] if there is to many errors. This [send error] script could be any script you choose or don't include any.)

12: Set EmailTrigger.fp7 to open with the email account.

13: Create 3 fields in EmailTrigger.fp7:

a: Normal [text] >error< field.-----used to store the error code

b: Global [text] >get_last_error< field.-----used to set the error code

c: Global [number] >Attempts< field.-----used to set number of error of error attempts

14: Create a [onopen] script that activates when the file is opened.

15: The script [onopen] opens the solution on the Server Advanced and preforms the following script:

Set error capture on

If attempts > 20

Set field attempts; ""

Preform script [send Rapport]

Flush Cache to Disk

Close File [Current File]

else

Preform Script [schedule Next] from file: Your Solution on Server Advanced

If Get last error = 0

Set Field attempts ""

Flush Cache to Disk

Close File [Current File]

else if Get last error = 0

Set Field attempts ""

Flush Cache to Disk

Close File [Current File]

else if Get last error = 100

New record/Request

Set Field attempts [attempts + 1]

Set Field get_last_error [Get Last Error]

Flush Cache to Disk

Close File [Current File]

else if Get last error = 130

New record/Request

Set Field attempts [attempts + 1]

Set Field get_last_error [Get Last Error]

Flush Cache to Disk

Close File [Current File]

else if Get last error = 300

New record/Request

Set Field attempts [attempts + 1]

Set Field get_last_error [Get Last Error]

Flush Cache to Disk

Close File [Current File]

else if Get last error = 802

New record/Request

Set Field attempts [attempts + 1]

Set Field get_last_error [Get Last Error]

Flush Cache to Disk

Close File [Current File]

else if Get last error = 820

New record/Request

Set Field attempts [attempts + 1]

Set Field get_last_error [Get Last Error]

Flush Cache to Disk

Close File [Current File]

else if Get last error = 821

New record/Request

Set Field attempts [attempts + 1]

Set Field get_last_error [Get Last Error]

Flush Cache to Disk

Close File [Current File]

else if Get last error = 951New record/Request

Set Field attempts [attempts + 1]

Set Field get_last_error [Get Last Error]

Flush Cache to Disk

Close File [Current File]

end if

end if

16: Run the application DoThisNow on the [MiniMac] and set it to open the EmailTrigger.fp7 file with your specified interval [i use 15 minutes], then your are sure that FileMaker is up and running.

That's it - email from IWP with 3 party plugin's on FileMaker Server Advanced.

Regards

Posted

Hi Jan,

Thanks for taking the time to write up that very detailed system. I had a similar idea as we run an Open/Close FileMaker database that we trigger at timed intervals with an app called Alarm Clock Pro.

I was hoping to not have to use another computer in the system... But if that is the only way to accomplish it... I hate the fact that to send a simple email, I have to use an elaborate system like this.

Any other good solutions out there?

Jerremy

This topic is 7243 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.