Help with implementing a macro

I’d like it to work the following way:

iex> MacroTest.my_macro(:sender, "hi")
"hi from MacroTest"

iex> MacroTest.my_macro(:printer, "hi")
hi from MacroTest
:ok

I’m trying to replicate a conceptual example of the instrument/3 macro. I just can’t seem to reproduce it due to my lack of understanding of macros.

I thought my_fun/3 was being called in the quoted context for example, because it is being called from within the macro definition.