Thread: Post Admin name

Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1
    Join Date
    Jul 2004
    Posts
    132
    Plugin Contributions
    0

    Default Post Admin name

    Hi

    How do I change the following code to post the actual 'admin_name' from the admin table into the 'sent_fistname' field in the coupon_email_track table?

    I think this is the code to alter in the relevent file:

    $db->Execute("insert into " . TABLE_COUPON_EMAIL_TRACK . "
    (coupon_id, customer_id_sent, sent_firstname, emailed_to, date_sent)
    values ('" . $insert_id ."', '0', 'Admin',
    '" . $mail['customers_email_address'] . "', now() )");


    Thanks.

  2. #2
    Join Date
    Jun 2003
    Posts
    33,825
    Plugin Contributions
    0

    Default Re: Post Admin name

    What are you trying to accomplish?

  3. #3
    Join Date
    Mar 2004
    Posts
    16,019
    Plugin Contributions
    5

    Default Re: Post Admin name

    Looks like he wants to add

    this coupon was sent curtesy of ( admin real name here )

  4. #4
    Join Date
    Aug 2004
    Posts
    1,590
    Plugin Contributions
    1

    Default Re: Post Admin name

    The following bolded statement is the one you need to modify from your quote above:


    $db->Execute("insert into " . TABLE_COUPON_EMAIL_TRACK . "
    (coupon_id, customer_id_sent, sent_firstname, emailed_to, date_sent)
    values ('" . $insert_id ."', '0', 'Admin',
    '" . $mail['customers_email_address'] . "', now() )");
    it should be changed into the existent string that actually gathers the sender's firstname.

  5. #5
    Join Date
    Jul 2004
    Posts
    132
    Plugin Contributions
    0

    Default Re: Post Admin name

    Quote Originally Posted by TheOracle
    The following bolded statement is the one you need to modify from your quote above:



    it should be changed into the existent string that actually gathers the sender's firstname.
    I totally agree, what I want to substitute it with is, the detail of whatever the admin user who is logged in at the time is.

    For example, say John who works for us, is logged in to the admin backend of the store sends a credit to a customer, it would show him as the sender on the report.

    Hope you follow if not please feel free to let me know.

  6. #6
    Join Date
    Aug 2004
    Posts
    1,590
    Plugin Contributions
    1

    Default Re: Post Admin name

    I thought ... it was already like that.

    I'd sure be happy to make this modification. I will post the results shortly (if no one else post it before I do).

  7. #7
    Join Date
    Mar 2004
    Posts
    16,019
    Plugin Contributions
    5

    Default Re: Post Admin name

    this is only hindered by the fact that unless you use your employees real names for usernames it could look rather funny.

  8. #8
    Join Date
    Aug 2004
    Posts
    1,590
    Plugin Contributions
    1

    Default Re: Post Admin name

    Ok, let's try this out:


    $db->Execute("insert into " . TABLE_COUPON_EMAIL_TRACK . "
    (coupon_id, customer_id_sent, sent_firstname, emailed_to, date_sent)
    values ('" . $insert_id ."', '0', 'Admin',
    '" . $mail->fields['customers_email_address'] . "', now() )");
    change to:

    Code:
    $db->Execute("insert into " . TABLE_COUPON_EMAIL_TRACK . "
                        (coupon_id, customer_id_sent, sent_firstname, emailed_to, date_sent)
                        values ('" . $insert_id ."', '0', '".$from."',
                                '" . $mail->fields['customers_email_address'] . "', now() )");
    After applying these modifications, it should show the current admin's email as result.

    Then, lower, change this block:


    $insert_query = $db->Execute("insert into " . TABLE_COUPON_EMAIL_TRACK . "
    (coupon_id, customer_id_sent, sent_firstname, emailed_to, date_sent)
    values ('" . $insert_id ."', '0', 'Admin',
    '" . $_POST['email_to'] . "', now() )");
    to read:

    Code:
    $insert_query = $db->Execute("insert into " . TABLE_COUPON_EMAIL_TRACK . "
                                        (coupon_id, customer_id_sent, sent_firstname, emailed_to, date_sent)
                                        values ('" . $insert_id ."', '0', '".$from."',
                                                '" . $_POST['email_to'] . "', now() )");
    Note: Backup your file first.

  9. #9
    Join Date
    Jul 2004
    Posts
    132
    Plugin Contributions
    0

    Default Re: Post Admin name

    Really appreciate your help Guys - I'm toatally lost on this one!

    Unfortunately '$this' is not holding the required info. Are you sure that that is the variable holding the admin logged in users identity?

  10. #10
    Join Date
    Aug 2004
    Posts
    1,590
    Plugin Contributions
    1

    Default Re: Post Admin name


    Unfortunately '$this' is not holding the required info. Are you sure that that is the variable holding the admin logged in users identity?
    Unfortunitely, I cannot find any results on this topic where I mentionned anything about '$this'. I can only find: '$from'. Perhaps you saw another word when reading my last post.

 

 
Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •