Skip to main content

Is it possible in BVMS 12.2 to send license plate details as text in an alarm email to a 3rd party software?

Question

Is it possible in BVMS 12.2 to send license plate details as text in an alarm email to a 3rd party software?

Answer

Yes, this is possible, but not directly through the standard way, which is to send an email on alarm.

The reason is that, when using the standard function, the email sent on alarm will send only the ‘Alarm Title’ and the ‘Device Name’. Is not possible to send the License Plate String.

The suggested way will be to implement an Event Receiver, that listens for the ‘License Plate Detected’ event. And on this event use ‘SendManager’ to send an email.

  1. Configure the Event: License Plate Detected

event.png
  1. Make a server scriplet that sends an email including the string with the Number Plate.

Below you can find the scriplet. Note that it will require some tailoring depending on your mail setup. 

//This is a server scriplet that should be started on Event - License Plate Detected

// The scriplet filters the Number Plate String and sends E-Mail.

 

public void ServerScriptletSendEMail(EventData e)

 

{

 

//First get the number plate string from the Number Plate Detedted Event

 

string allEventData = e.ToString();

numberPlateString = "";

 

foreach (KeyValuePair<string, string> kvp in e)

                {

                    string key = kvp.Key;

                    string value = kvp.Value;

 

                    //use the value and the key   

                    if (key.Equals("LicensePlateString"))

                    {

                        //value is the numberplate

                                           numberPlateString = value;

                        break; // get out of the loop

                    }

                }

 

  // send mail without provider information

  Api.SendManager.Mail("test@tester.de","test@tester.de","Without Provider",numberPlateString);

 

  // send mail with provider information

  MailProvider m = Api.SendManager.GetMailProviderByName("mailserver");

  if (m==null)

  {

    Logger.Error("****************Mail could not be send. m = null. *************");

    return;

  }

  Api.SendManager.Mail(m, "test@tester.de","test@tester.de","With Provider",numberPlateString); 

}

  1. This scriplet should be started on the event configured at point 1.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.