{$page}

EFax is a service that allows you to email to a fax machine. Once setup, you can send an email to

1nnnnnnnnnn@efaxsend.com

with an attached PDF or Word document and it will then send the fax to the fax number in the email. For more information on the service, including pricing, see http://www.efax.com.

The challenge was to configure the email address using the fax address. The email address supports the use of mail merge fields, but unfortunately I was not able to get the fax number to work and build the address there. It had problems of containing dashes, spaces, etc. which are rejected by eFax.

So, I created a contact UDF to store the formatted fax number and used a SQL Query (attached to the menu) to update the eFax numbers before I sent them out. Then I referenced the UDF field in the email address and it took care of the problem.

Perfect this with one order before sending it en masse'.

  1. Create a Contact UDF called EFax Number (with a space between) of type text.
  1. Restart Control so the UDF is created.
  1. Create a SQL Report in the main menu with query in the next section.
  1. Run the SQL Report to update the UDFs. (Note, because this happens in SQL and Control doesn't know about it, you may not see it if you already had the customer record open. If you close Control and restart it should be there.)
  1. Open a test order (preferably one where you are the ordered).
  1. Send a test email, using the UDF containing the efax email address …
Query to Update the Contacts UDF

code_formatsql

update AccountContactUserField

set eFax_Number = (Select

                    case when Substring(FaxNumber, 1, 1) not in ('0', '1') 
                    then '1'+FaxNumber 
                    else FaxNumber 
                    end + '@eFaxSend.com' 
                  from
                  (
                      select ID as ContactID, AccountID,
                         SecondaryNumber, SecNumberTypeID, SecNumberTypeText,
                         REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(SecondaryNumber, '(', ''),')', ''), '-', ''),' ', ''), '.', ''), '011+', '011'), '+', '011')
                         as FaxNumber
                      from AccountContact AC
                      where SecondaryNumber is not null 
                        and LEN(RTrim(SecondaryNumber)) > 12
                        and SecNumberTypeID = 11
                  ) TempFax
                  where ContactID = ID
                  )

where ID in (Select ID

           from AccountContact AC
           where SecondaryNumber is not null 
                 and LEN(RTrim(SecondaryNumber)) > 12
                 and SecNumberTypeID = 11
           )

code

Contributor: Team Cyrious

Date: 5/2010

Version: Control 5.0+

You could leave a comment if you were logged in.