Customising payment emails

Discussion in 'aMember Pro v.4' started by piratepete, Jan 28, 2013.

  1. piratepete

    piratepete aMember Pro Customer

    Joined:
    Apr 14, 2009
    Messages:
    23
    Hi,

    I'm trying to customise the payment emails sent to the admins. I have sorted out showing the main fields, such as %user.street%, %user.city%, %user.state%, etc. But for the life of me I can't work out how to show any custom fields I have created, such as the membership number, which appears as 'membership_no'. In the main fields, such as %user.street% I assume the 'user' bit refers to the 'user' table in the database, but I can't find what table holds the custom fields - I can see them in the 'data' table, but using %data.membership_no% doesn't show anything.

    Any idea what I should be putting into the custom emails to show the custom fields?

    Thanks
  2. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
    You can try
    %user.data.field_name%

    David
  3. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Change custom fields to "SQL" and use %user.FIELDNAME% variable.
  4. piratepete

    piratepete aMember Pro Customer

    Joined:
    Apr 14, 2009
    Messages:
    23
    Thanks guys. Alexander, if I change the fields to 'SQL' will this affect any existing data or will that be moved into the relevant table?
  5. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Yes value will be converted automatically.
  6. piratepete

    piratepete aMember Pro Customer

    Joined:
    Apr 14, 2009
    Messages:
    23
    Excellent, thank you. Just done it and all converted fine - will make the emails a lot easier to do. One question...on the 'Edit Field' form you state 'sql field will be added to table structure, common field will not, we recommend you to choose second option' - what is the reason for recommending the second option?
  7. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    There are two possible reasons:

    1. If you need to have a lot of custom files, each will be added to MySQL table. and there is a limit for the number of table's columns in MySQL.
    2. aMember's user table could be altered on upgrades and there is a chance that new field with the same name could be added.
  8. piratepete

    piratepete aMember Pro Customer

    Joined:
    Apr 14, 2009
    Messages:
    23
    That makes sense, thanks. Won't be adding any more fields and very unlikely that any new fields will have the same name as our fields, so that is good to know. Thanks, Alexander!

Share This Page