# failure down the line if handling many targets
return undef unless @$targets;
+
+ if ($hook eq 'email.selfcheck.checkout') {
+ # KCLS JBAS-1728
+ # Avoid firing passive email events here. Create the events,
+ # then let them fire via the regular A/T processor.
+ for my $target (@$targets) {
+ $U->create_events_for_hook(
+ $hook, $target, $org_id, $granularity, $user_data);
+ }
+ return 1; # indicate successy-ness
+ }
+
return $U->fire_object_event($event_def, $hook, $targets, $org_id, $granularity, $user_data);
}
this.staff.ws_ou(),
null,
'email.selfcheck.checkout',
- 'print-on-demand',
+ '', // granularity
circIds,
circCtx
];
params : params,
oncomplete : function(r) {
var resp = openils.Util.readResponse(r);
- var output = resp.template_output();
- if(output) {
- if (callback) callback();
- } else {
- var error = resp.error_output();
- if(error) {
- throw new Error("Error creating receipt: " + error.data());
- } else {
- throw new Error("No receipt data returned from server");
- }
+ var evt = openils.Event.parse(resp);
+ // Email events are passive, so all we're doing here is
+ // creating an event that will be fired later.
+ if (evt) {
+ throw new Error("Error creating receipt email: " + evt);
+ } else {
+ if (callback) callback();
}
}
}