Alex's Support Forums » Resources

Simple User Trick - Recipient's email

(3 posts)
  • Started 5 months ago by nortongulch
  • Latest reply from nortongulch

  1. nortongulch
    Member

    Client wanted to cut and paste address information from his email received when user visits site to create mailing label.

    As written, SimpleContact includes a label (ie., Address Line 1:) before each field. This can easily be modified in sc_admin\include\contact\posted.php. Instead of deleting labels from existing code (always a pain in the neck when dealing with code that will be updated periodically by the developer -- 1.0, 1.1, 1.2, etc.), I have chosen to add some values to the $notify_body variable.

    At then end of $notify_body -- just before the end quote and semi-colon (";), add the following:

    \n----------------------------------------------\nInfo for Address Label:\n\n$label_name$label_position$label_company$label_addr1$label_addr2$label_town$label_country

    To support these new values which adds a new line (\n) if there is field is not blank, add the following definitions just below:
    if ($pcode != "") {$show_pcode = "Post / ZIP code: $pcode\n";} else {$show_pcode = "";}

    Add:
    if ($name_full != "") {$label_name = "$name_full\n";} else {$label_name = "";}
    if ($position != "") {$label_position = "$position\n";} else {$label_position = "";}
    if ($company != "") {$label_company = "$company\n";} else {$label_company = "";}
    if ($addr1 != "") {$label_addr1 = "$addr1\n";} else {$label_addr1 = "";}
    if ($addr2 != "") {$label_addr2 = "$addr2\n";} else {$label_addr2 = "";}
    if ($town != "") {$label_town = "$town $pcode\n";} else {$label_town = "";}
    if ($country != "") {$label_country = "$country\n";} else {$label_country = "";}

    Posted 5 months ago #
  2. Thanks for this!

    Note to all users: If you modify the simpleContact code to suit your particular needs, please do post on these forums. Not only does it help other users, but if there is evidence of significant demand I may decide to roll a feature into the mainstream release.

    Please also take care when upgrading from a customised copy. Be sure to back up your files so that your changes can be reinstated.

    Posted 5 months ago #
  3. nortongulch
    Member

    Amen to your Note!

    Reminds me of an ages old backup program or drive, can't remember which that had a sign "Blessed are the pessimists as they hath made backups."

    Posted 5 months ago #

RSS feed for this topic

Reply

You must log in to post.