MATLAB function

If you want to trigger a raw notification from a MATLAB  script, you can use the following function:

notify17.m
function notify17(rawAPIKey, title, content)
%NOTIFY17 Triggers a notification using Notify17
%
% Parameters:
% * rawAPIKey (required) - https://dash.notify17.net/#/rawAPIKeys
% * title (required) - Notification title
% * content (optional) - Notification content

if nargin <= 2
  content = '';
end

url = strcat('https://hook.notify17.net/api/raw/', rawAPIKey);

options = weboptions('RequestMethod', 'post', 'ArrayFormat', 'json', 'ContentType', 'text');
data = webread(url, 'title', title, 'content', content, options);

disp(['Notify17 response: ', data]);
end

Usage (e.g. when you want to know if a simulation completes successfully or not):

testN17.m
n17RawAPIKey = 'RAW_API_KEY';

try
    % Code which may trigger an error
    % e.g. missing arguments
    plus
    
    notify17(n17RawAPIKey, 'Simulation completed', ...
        'The simulation has completed successfully');
catch ex
    notify17(n17RawAPIKey, 'Simulation error', ...
        "An error has been encountered:" + newline + ...
        getReport(ex,'extended','hyperlinks','off'));
end

Output:

Simulation error
---
An error has been encountered:
Error using +
Not enough input arguments.

Error in testN17 (line 6)
    plus