Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sender: set options when creating new sender object #239

Merged
merged 1 commit into from
Jul 4, 2024

Conversation

Davis-A
Copy link
Contributor

@Davis-A Davis-A commented Jun 24, 2024

When using the sender from perl directly, there was no way to set the options without twiddling with the sender objects internals which is always a cursed thing to do.

Allow explicit setting of those options when creating the object.

@marcbradshaw marcbradshaw self-assigned this Jun 24, 2024
@marcbradshaw
Copy link
Collaborator

I think it would be worth adding the remaining 4 options so they can all. be set using args.

    smarthost => undef,
    transports_method => undef,
    transports_object => undef,
    dkim_key => undef,

@Davis-A
Copy link
Contributor Author

Davis-A commented Jul 3, 2024

I think it would be worth adding the remaining 4 options so they can all. be set using args.

Okie dokie.

Just an FYI, I deliberately only allowed setting the subset of keys that can be set via CLI (hence also why the naming of the arg doesn't match the internal key, i matched the cli options).

    GetOptions (
        'verbose+'   => \$self->{verbose},
        'delay=i'    => \$self->{send_delay},
        'batch=i'    => \$self->{batch_size},
        'timeout=i'  => \$self->{alarm_at},
        'syslog+'    => \$self->{syslog},
    );

When using the sender from perl directly, there was no way to set the
options without twiddling with the sender objects internals which is
always a cursed thing to do.

Allow explicit setting of those options when creating the object.
@Davis-A Davis-A force-pushed the sender-set-options branch from 1aced36 to 3398cd6 Compare July 3, 2024 22:34
@marcbradshaw marcbradshaw merged commit 25cb7c1 into msimerson:master Jul 4, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants