pip_clients_emailsettings 1.1.0 copy "pip_clients_emailsettings: ^1.1.0" to clipboard
pip_clients_emailsettings: ^1.1.0 copied to clipboard

Clients for Email Settings microservice for Pip.Services in Dart. This microservice keeps settings of email recipients.

example/README.md

Examples for Email Settings Microservice #

This is a email settings microservice from Pip.Services library. This microservice keeps settings of email recipients.

Define client configuration parameters that match the configuration of the microservice's external API

// Client configuration
var httpConfig = ConfigParams.fromTuples(
	"connection.protocol", "http",
	"connection.host", "localhost",
	"connection.port", 8080
);

Instantiate the client and open connection to the microservice

// Create the client instance
var client = EmailSettingsHttpClientV1(config);

// Configure the client
client.configure(httpConfig);

// Connect to the microservice
try{
  await client.open(null)
}catch() {
  // Error handling...
}       
// Work with the microservice
// ...

Now the client is ready to perform operations

// Create a new settings
final SETTINGS = EmailSettingsV1(
    id: '1',
    name: 'User 1',
    email: 'somebody@somewhere.com',
    language: 'en',
    verified: false);

    // Create the settings
    try {
      var settings = await client.setSettings('123', SETTINGS);
      // Do something with the returned settings...
    } catch(err) {
      // Error handling...     
    }
// Get the settings
try {
var settings = await client.getSettingsByEmail(
    null,
    'somebody@somewhere.com');
    // Do something with settings...

    } catch(err) { // Error handling}
// Verify an email
try {
    settings1 = SETTINGS;
    settings1.ver_code = '123';  
    await controller.verifyEmail(null, '1', '123');

    var settings = await client.getSettingsByEmail(
    null,
    'somebody@somewhere.com');
    // Do something with settings...

    } catch(err) { // Error handling}

In the help for each class there is a general example of its use. Also one of the quality sources are the source code for the tests.

0
likes
140
points
1
downloads

Publisher

verified publisherentinco.com

Weekly Downloads

Clients for Email Settings microservice for Pip.Services in Dart. This microservice keeps settings of email recipients.

Homepage

Documentation

API reference

License

MIT (license)

Dependencies

http, pip_clients_email, pip_services3_commons, pip_services3_components, pip_services3_data, pip_services3_rpc, pip_services_emailsettings

More

Packages that depend on pip_clients_emailsettings