Built in email function

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
amciotola
User
Posts: 10

Built in email function

Post by amciotola »

I have two things I'm trying to get to work, one major, one minor.

The major:

I'm trying to play around with the built in email function in v11 and wondered if there a way to create email templates that could be used instead of the free form given or having the html table be sent?

For example, when a user clicks on the email icon could I list the options of which template to send? Like Send Invoice, Send Part Order Form, Send Work Order. Wherein I am using one database but picking and choosing which fields to send in the email depending on who I want to send the email to, the vendor or the customer. I don't want to send a table but a custom form that would include my logo.gif.

The minor:

Where is the css file that sets the table views. I would like to widen the title column of the Add New Record page because it is doing word wrap instead of expanding to fit the longest title. I would like to expand it and add some color to it.

Any help would be appreciated.

Annette


danielc
User
Posts: 1601

Post by danielc »

  1. Take a look at the cEmail class in phpfn*.php. You may use this method, Load($fn), to load your own template depend on your table name. Or you can just set the Content property of the $Email object in the server event as your own HTML. Or you can customize the email templates in the template (see *.txt files in the template).

  2. You may add your user css to overwrite style, click [HTML]->[Style]->[Edit style] and scroll down to bottom and enter yours after this line, /* your CSS styles here */. See HTML Settings in help file.


Adam
User
Posts: 480

Post by Adam »

if you're able to use the Email_Sending server event then you can replace any default message with something like this:

function Email_Sending(&$Email, &$Args) {
$Records = ew_LoadRecordset("SELECT ProfileID, Password FROM office_profiles WHERE Email = '{$Email->Recipient}'");

$Message =  "Thank you for requesting a reminder of your various account credentials.\n\n";
$Message .= "------------------------------------------------\n";

while (!$Records->EOF)
{
    $Message .= "User Name: {$Records->fields['ProfileID']}\n";
    $Message .= "Password : {$Records->fields['Password']}\n";
    $Message .= "------------------------------------------------\n";

    $Records->MoveNext();
}

$Message .= "\nIf you have any issues or questions then please contact us via email (info@xxxxxxx.com) or via our live-chat system.\n\n";
$Message .= "If choosing to contact us via email, please remember that messages are often blocked by free email providers (i.e. Hotmail, Gmail, etc.) and that any response we send you may appear in your Junk folder.\n\n";
$Message .= "Regards,\n\n";
$Message .= "Support\n";

$Email->Content = $Message;

// var_dump($Email); var_dump($Args); exit();
return TRUE;

}


amciotola
User
Posts: 10

Post by amciotola »

I just fixed my own problem but shear dumb luck.

I was putting my custom code under the view page custom template and when I send this as an email it does exactly what I've been trying to do.

Thank you to all who have offered advice.

Annette :)


Post Reply