Forums

[resolved] [Plugin: MailPress] Get userID in Mailpress _loop.php (3 posts)

  1. herbie4
    Member
    Posted 1 year ago #

    In the MailPress template _loop.php I am trying to get the userID to built a personal link for another application. I am using the following code, which works fine if there is only 1 subscriber.

    <?php
    $email = $this->args->toemail; // current email
    $uid = MP_Users::get_id_by_email($email); // get UserID
    ?>

    How to change it so it works in the loop for multiple subscribers?

  2. herbie4
    Member
    Posted 1 year ago #

    UPDATE
    In the mailpress API it says:

    $args->toemail (string) (optional) for multi recipient email see $args->replacements

    So I tried using this:

    $email = $this->row->toemail; // for multiple recipients

    But there is no result...

    Suggestions anyone?

  3. herbie4
    Member
    Posted 1 year ago #

    Solved it after some digging via Google.

    Now I used: {{_user_id}} directly in the template.
    That works!

Topic Closed

This topic has been closed to new replies.

About this Topic