A notice that invites the borrower to submit a critique is automatically sent when an item is returned to the library and the administrator checks in the item. The Corporate Media Library already had a stored procedure, (fm_admin_checkin), which updated the FmLib database when an item was checked in, and now this stored procedure is changed to run the lc_admin_send_notice stored procedure.
begin
--Sends request for submitting critique for checked in title
select @critiqueenabled = critiqueenabled from settings
if @critiqueenabled = 1
begin
exec lc_admin_send_notice @borrowerNo,@bibNo
end
The lc_admin_send_notice stored procedure is very similar to the fm_admin_send_notice stored procedure developed for the Corporate Media Library application featured in Scenario 1. Like fm_admin_send_notice, the lc_admin_send_notice stored procedure sends a message to a borrower using xp_sendmail. The message contains the URL to the intranet site where the CML/LitCrit application is available.
exec master.dbo.xp_sendmail @recipients = @alias , @query = 'SELECT c1 FROM ##TEMP',
@subject = 'LitCrit Submission Request', @no_output = 'False', @no_header='TRUE',
@width = 100
The lc_admin_send_notice topic in Code Listings and Object Reference contains all the statements in this procedure.
Note The nature of the invitation sent by the CML/LitCrit application changed between the application's design phase and the application's completion. To see the original (more ambitious) plans, see Submitting a Critique by Invitation.