Jump to:

23478 Posts in 18941 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Emailing image $Avatar

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 528 Views
  • borriej
    Community Member
    267 Posts

    Emailing image $Avatar Link to this post


    I have memberprofiles in place with a registerform on the front-end. People can register and they get added to the Member table. I also have forum module installed, and therefor Member table is extended with a Avatar. People can upload an Avatar in the registration form. This all works, and you can view the avatar in your online profile or in the CMS (as admin).

    After registration a few emails get send: 1 to Admin, 1 to user.

    Ok now my issue:
    in the emails i would like to include the avatar.. but how?

    ive tried lots of things, like

    <% control AvatarID %>
    <img src="$SetWidth(150).Link" />
    <% end_control %>
    <% control Avatar %>
    <img src="$SetWidth(150).Link" />
    <% end_control %>

          <img class="userAvatar" src="$FormattedAvatar" alt="Avatar" /><br />

    but they all result in a broken path/link for the image source..

    How do i include the avatar in the data that gets send?

    my email function:

       function onBeforeWrite() {

    if (!$this->owner->exists()) {

             /* ADMIN EMAIL ACTIVATE */
             $AdminEmail = new Email();
             $AdminData = $this->owner->getAllFields();
             $AdminToAddress = Email::getAdminEmail();
             $AdminEmail->setSubject('Nieuw lid: Activatie vereist');
             $UserEmail = new Email();
             $UserData = $this->owner->getAllFields();
             $UserFromAddress = Email::getAdminEmail();
             $UserEmail->setSubject('Uw account is aangemaakt');

Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.