EPrints Technical Mailing List Archive

See the EPrints wiki for instructions on how to join this mailing list and related information.

Message: #05582


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

Re: [EP-tech] Adding a pin to a subject line using User->Mail


Hi Adam,

You can use a phrase with pins – but need to make sure you’re using a chunk of text rather than an XML fragment (possibly using the ‘phrase’ rather than ‘html_phrase’)

$user->mail(

    $session->phrase(

        “phrase_with_eprintid_pin_in_it”,

        eprintid => $eprintid,

    ),

)

 

If you want to use other data, that’s already rendered you might need to ‘flatten’ it to use it:

 

$user->mail(

    $session->phrase(

        “phrase_with_users_name_pin_in_it”,

        users_name => EPrints::Utils::tree_to_utf8( $users_name ),

    ),

),

 

Cheers,

John

 

From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Vials Moore, Adam
Sent: 21 April 2016 13:26
To: eprints-tech@ecs.soton.ac.uk
Subject: [EP-tech] Adding a pin to a subject line using User->Mail

 

Hey all!

 

I’m trying to send an email notification about an item using the user->mail method

 

This uses a phrase as the subject HOWEVER I’d really like to set the eprintid and I can’t figure out a way to define it, as the method seems only to allow the phrase as part of the call

 

So – at the moment it looks like:

 my $result = $user->mail( "eprint_thesis_notify_mail_subject", $mail );