EPrints Technical Mailing List Archive
See the EPrints wiki for instructions on how to join this mailing list and related information.
Message: #09016
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
Re: [EP-tech] email notification on a specific metadata field value change
- To: "eprints-tech@ecs.soton.ac.uk" <eprints-tech@ecs.soton.ac.uk>, "Tomasz Neugebauer" <Tomasz.Neugebauer@concordia.ca>
- Subject: Re: [EP-tech] email notification on a specific metadata field value change
- From: John Salter <J.Salter@leeds.ac.uk>
- Date: Wed, 3 Aug 2022 21:37:10 +0000
CAUTION: This e-mail originated outside the University of Southampton.
This sounds like a job for a commit trigger. You can check whether the field you are interested in is a key in the changed hash, and use that as a basis for sending an email. NB The example below may not be syntactically correct. It's lashed together late at night (for me anyway), but I think you'll get the idea. Happy to
answer questions about it in (my) morning! Cheers, John $c->add_dataset_trigger( 'eprint', EPrints::Const::EP_TRIGGER_BEFORE_COMMIT, sub { my( %args ) = @_; my( $repo, $user, $changed ) = @args{qw( repository dataobj changed )}; if( exists $changed->{'the_field_youre_interested_in'} ) { my $old_val = $changed->{'the_field_youre_interested_in'}; my $new_val = $eprint->get_value( 'the_field_youre_interested_in' ); # generate an email alert } }, priority => 73);
From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk]
On Behalf Of Tomasz Neugebauer via Eprints-tech CAUTION:
This e-mail originated outside the University of Southampton. Another question from me, I hope I don’t get blocked for posting too many!
I would like to add an email notification that would be sent out to the depositor when a specific editor-only metadata field changes in a deposit. What would be the best/easiest way to get that done?
This method is the only way that comes to mind, but it seems complicated. Would I need to
1.
add an item field with a date value,
2.
use “automatic fields.pl” to insert a date of when the field changes into it whenver the field that I want monitored changes, and
3.
run a batch script nightly to send the notification email to for all those items that have “today’s” date in the monitor field Or could I use a trigger mechanism on this field to send out the email?
Tomasz
|
- Follow-Ups:
- Re: [EP-tech] email notification on a specific metadata field value change
- From: John Salter <J.Salter@leeds.ac.uk>
- Re: [EP-tech] email notification on a specific metadata field value change
- References:
- [EP-tech] email notification on a specific metadata field value change
- From: Tomasz Neugebauer <Tomasz.Neugebauer@concordia.ca>
- Re: [EP-tech] email notification on a specific metadata field value change
- From: John Salter <J.Salter@leeds.ac.uk>
- [EP-tech] email notification on a specific metadata field value change
- Prev by Date: Re: [EP-tech] depositing user email in the Review table
- Next by Date: Re: [EP-tech] depositing user email in the Review table
- Previous by thread: [EP-tech] EPrints/CRIS
- Next by thread: [EP-tech] DOI handling in orcid_support_advance
- Index(es):