Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

IWP and PHP for emailing and scripts?

Featured Replies

Can someone explain how an IWP button/ script could generate an smtp email via php, etc? Do you use openurl script step and pass params? If so, does this require a pop-up window? Is it professional? Secure? Can it be done behind the scenes without the user knowing? I want a button from IWP to generate an email back to the creator of the record's email (to authenticate email address). Within the body of the email that was generated would be a link to FMP that would set a status field="active" and perhaps perform another script, thereby authenticating the user. Examples, books or resources to learn how to do this would be GREATLY and SINCERELY appreciated!

Open URL is about the only Script Step that may do the job (i.e. Web Compatible). You could have it call a PHP script (or similar) to construct and send the email.

Good Luck.

Garry

  • Author

Thanks for the response! Do you know of any online examples so I could see in action? Could this be performed totally behind the scenes so that the user wouldn't see? Finally, do you have any recommendations on books, etc. for learning this stuff? Thanks again for your time!

I don't know of any examples. However, I have any application that has a Script which uses Applescript and PHP to import (sync) data from a MySQL database.

I can't see any reason why the Script and the sending of the email will not be hidden from the user.

Books with content on Instant Web Publishing (IWP) and Scripts may not exist. However, FMWebSchool have books on PHP and FM.

All the best.

Garry

Hi there,

you could write it al in php, but since you're using IWP you dont want the hasssle of iwp. There is a way ot create the email by using the scriptstep mail.

But that's not satisfying. Check out the SMTP-it form on sending email with plugins. (full html fat, soggy rich emails) Getting the answer back, though requires skills in php finding and editing records.

Read www.fm-and-php.info and it'll become more clear. It's an easy php class you'll master in a few hours (days).

Good luck programming!

Herrix

I think Gary was on the right track. The OpenURL command would be fed a value that was the php script, along with the data you wanted to send as a message. These would be appended to the base URL as name/value pairs, like so:

ww w.mysite. com/[email protected]⊂=Your%20Subject&body=Your%20text%20here

s_mail.php would parse this into the php command for sending mail. Something like:

* s_mail.php to parse msg from fm and send

$to = $_GET['to'];

$sub = $_GET['sub'];

$body = $_GET['body'];

$sent = mail($to, $sub, $body);

Keep in mind that according to the PHP docs, you will need to have access to the sendmail binary on your system in order for this to work.

As for the rest of your questions (professional, secure, hidden, etc.) I would just try it all out and see what happened...

David

Edited by Guest

See if this is along the lines of what you are requesting.

http://www.fmwebschool.com/resources/iwpphp/iwpphp.html

In Kindness

Stephen K Knight

http://www.fmwebschool.com

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.